Why is google analytics data not being collected for my android Flutter app?
Adding firebase_core (Step 4 here) solved the problem. Since it was not required for iOS, I had skipped it, only later to find it mandatory for Android. Now analytics data is automatically being collected for both android and ios app.
Sujal
Updated on November 28, 2022Comments
-
Sujal over 1 year
I have released the android app and the iOS app of my Flutter project. In my project, I have used firebase_messaging and firebase_remote_config libraries and both of these features are properly working in both android and iOS app. Google Analytics is enabled in the Firebase project. From the analytics dashboard, it is seen that the analytics data (e.g. daily active users, first_open event etc) are automatically being collected for the iOS app, but not for the android app.
I have properly followed Steps 1-3 mentioned here in the official documentation. However, in the dashboard I am getting the following for android.
What point am I missing in android project setup? Is this related to SHA certificate fingerprint? Currently, I have only SHA-1 added.
How do I resolve this?
-
Stijn2210 about 3 yearsAdd pub.dev/packages/firebase_analytics to your app. It will provide steps to add it to the Android app as well.
-
-
Sujal about 3 yearsI do not need to track the page navigations, just need the data that Firebase tracks automatically when Firebase sdk is setup in the project. Without the navigator observer code, data is currently being tracked in iOS but not in android. So I am guessing thta there is a way to have it without adding the navigator observer, that i wanted to know.
-
Dan Gerchcovich about 3 yearsif you are not including navigation observers, and there is no code where you invoke firebase events, then nothing can get sent. You will need to manually write up events for android, based on the business logic you are calling. For example, you can create a firebase event that tracks when users make in app purchases, then send the information to firebase analytics as the event "card_purchase"
-
Dan Gerchcovich about 3 yearshere's a good article to get you started: medium.com/flutterdevs/firebase-analytics-2044e865efc4
-
Zane over 2 yearsI'm facing the same problem after my previous flutter update, it used to work even without firebase_core nor firebase_analytic plugin. I added the 2 plugins and the problem still persists. Can you please share what version of flutter, firebase_core and firebase_analytic you're using?
-
Sujal over 2 years@Zane My flutter version is 1.22.2, firebase_core and firebase analytics versions as used in pubspec.yaml file are ^0.4.0+9 and ^5.0.2 respectively.