Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 769
IRPdevelop Avatar asked Jun 09 '16 00:06

IRPdevelop


People also ask

Does Google Analytics use Firebase?

Google Analytics for Firebase helps you understand how people use your iOS or Android app. The SDK automatically captures a number of events and user properties and also allows you to define your own custom events to measure the things that uniquely matter to your business.


1 Answers

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>"
          }
        },
like image 178
Steve Ganem Avatar answered Oct 06 '22 12:10

Steve Ganem