Rahul N
Rahul N

Reputation: 35

Google Analytics not generating Configuration file, Firebase clash

Initially, I have included Firebase and it's analytics to my project. It worked well, but after realising Firebase anlytics doesn't have real-time data and other features compared to Google analytics, I wanted to include both. Now, when I try to generate the configuration file to include Google analytics in the app, it redirects me to the Firebase console, where I'm unable to a get a new configuration file.

firebase redirected image

In the Firebase I'm only getting the older version of the configuration file. Can anyone here please guide me to the the updated version?

The problem is with out that I will not be able to generate the xml - global_tracker for google analytics.

Upvotes: 3

Views: 1021

Answers (2)

Felipe Conde
Felipe Conde

Reputation: 2044

You can now, under the services session, include your analytics configurations like:

"services": { "analytics_service": { "status": 2, "analytics_property": { "tracking_id": "YOUR TRACKING ID HERE" } } } This will generate the global_tracker.xml file for you

Upvotes: 0

Ian Barber
Ian Barber

Reputation: 19980

Because Firebase is built around Firebase Analytics, it doesn't include the Google Analytics tracking ID in the config file unfortunately!

The easiest thing to do is just to add the tracker XML manually, then you don't have to worry about the config file at all for Google Analytics. There are a number of things you can put in there, but to recreate the setup by the google-services plugin use:

File: res/xml/global_tracker.xml

<?xml version="1.0" encoding="utf-8" ?>
<resources>
   <string name="ga_trackingId">UA-XXXX-X</string>
</resources>

Replace UA-XXXX-X with your tracker ID from Admin > Tracking Info in the Google Analytics console.

Upvotes: 3

Related Questions