IRPdevelop
IRPdevelop

Reputation: 281

Is it possible to use Firebase Messaging with Google Analytics in Android?

I started using Firebase Cloud Messaging for an Android app and now I'm trying to add Google Analytics (not Firebase analytics) to the same app.

The problem is that when creating google-services.json for Analytics, it ignores FCM. I'm using the same google account to create both json files.

I read that when enabling the second service (in this case Analytics) the json should update adding both Messaging and Analytics but maybe this only works within Firebase services?

I could use Firebase Analytics and actually that's what Google recommends, but is it possible to use both Google Analytics with Firebase services?

Upvotes: 10

Views: 5093

Answers (1)

Steve Ganem
Steve Ganem

Reputation: 10851

Yes, it is possible to use Firebase Cloud Messaging and Google Analytics in the same app. I would suggest using the json file generated by Firebase and merging in the following object into the "services" object :

 "analytics_service": {
          "status": 2,
          "analytics_property": {
            "tracking_id": "<your tracking id>"
          }
        },

Upvotes: 21

Related Questions