Why is google analytics data not being collected for my android Flutter app?

2,060

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.

Share:
2,060
Sujal
Author by

Sujal

Updated on November 28, 2022

Comments

  • Sujal
    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.

    enter image description here

    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?

  • Sujal
    Sujal about 3 years
    I 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
    Dan Gerchcovich about 3 years
    if 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
    Dan Gerchcovich about 3 years
    here's a good article to get you started: medium.com/flutterdevs/firebase-analytics-2044e865efc4
  • Zane
    Zane over 2 years
    I'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
    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.