Mehdzor
Mehdzor

Reputation: 799

FirebaseAnalytics: logging events to multiple projects

I need to send FirebaseAnalytics events to two separate accounts. I've tried working with pure GAI but it is not showing in Firebase console.

How could I do that?

Upvotes: 6

Views: 3011

Answers (3)

Mehdzor
Mehdzor

Reputation: 799

Answering my own question.

Judging by the documentation and heavy personal research: there is no legal (or without the black magic) way to split analytics data into two separate Firebase projects.

Quote:

Note: On Android and iOS, Analytics are only logged for the default app And switching default app on the fly didn't work.

Therefore, our team has decided to acquire google analytics account as a second analytics channel which solves our needs.

Hope it will help someone.

P.S. If you need to split debug data from release data watch Martin's answer.

Upvotes: 2

Martin Zeitler
Martin Zeitler

Reputation: 76639

here it is covered for Android, while on the Firebase console, it is exactly the same:

however, it might be better (unless the goal is to tell apart debug & release builds),

to tell apart by the CAMPAIGN and/or CAMPAIGN_DETAILS.

as the Firebase documentation for Reliable Analytics states:

If runtime configuration is required, please note the following caveats:

If you're using AdMob and request ads at startup as recommended, you may miss some Analytics data to related to mobile ads when not using the resource based configuration approach.

Only ever supply a single Google app ID in each distributed variant of your app. For example, if you ship version 1 of your app with a certain GOOGLE_APP_ID in the configuration then upload version 2 with a different ID, it may cause analytics data to be dropped.

On iOS, do not add GoogleService-Info.plist to your project if you are supplying different configuration at run time, as this can result in an apparent change of GOOGLE_APP_ID and result in lost Analytics.

also see Manage project members ...in order to grant access to another Google account.

telling apart by campaigns makes sense, because alike that one can have several campaigns, while being able to compare their performance - which one otherwise could not, at least not that directly.

Upvotes: 3

Jeremiah
Jeremiah

Reputation: 1461

You need to first configure two different apps in your project. Then you can log separately to each one of them.

More info here: https://firebase.google.com/docs/configure/#support_multiple_environments_in_your_ios_application

Upvotes: 2

Related Questions