Google analytic “GET A CONFIGURATION FILE” doesn&#

2019-04-19 23:11发布

问题:

I've a working google analytics integration done from the latest v4 documentation. Where we need to GET A CONFIGURATION FILE from here

But facing the following issue

I've two different tracking id for two separate apps on my google analytics account. For first app I got the google-services.json file which I placed inside the root directory and everything is working fine.

When I follow the steps to create the google-services.json for second app it doesn't let me to switch my account (see the attached pic - it takes the first account from my google analytics)

How I should create a separate google-services.json file for separate property id?

回答1:

From what is said on this site by Google, you can modify the json file from your first account with the property Id you want to use. Here is their answer:

This is currently working as intended even though it may not seem so. There may be an update to fix this but in the meantime you can just copy an existing Configuration file and edit it. The only thing you need to change is the Analytics tracking ID value.

For example, in the configuration JOSN file you'll see an entry like: "services": { "analytics_service": { "status": 2, "analytics_property": { "tracking_id": "UA-XXXXX-YY" } },

Replace the UA-XXXXX-YY value with the property ID (for the GA Account) you want to use. You can use the Account Explorer to find the correct property ID: https://ga-dev-tools.appspot.com/account-explorer/

Note that Tracking ID and Property ID mean the same thing.

Hope this helps!