Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 872
Mehdzor Avatar asked Aug 02 '18 09:08

Mehdzor


People also ask

Can you connect more than one Firebase project to your android app?

However, when you want to access multiple projects from a single application, you'll need a distinct Firebase application object to reference each one individually. It's up to you to initialize these other instances.

Can a Firebase project have multiple apps?

You're limited to one database per project. You'll need multiple projects to get multiple db instances. You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.

How multiple developers can work on the same android app connected to a single Firebase console?

You can't have two projects of the same package name. Even if you delete it. It will take a least 4-5 days to get deleted fully from the developer's console. So the only solution is to generate a new SHA-1 key by custom signing the app by generating a signed apk from the android studio.

How many projects can I have on Firebase?

A Firebase project is a container for Firebase Apps across Apple, Android, and web. Firebase restricts the total number of Firebase Apps within a Firebase project to 30.


3 Answers

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.

like image 117
Martin Zeitler Avatar answered Oct 17 '22 13:10

Martin Zeitler


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

like image 37
Jeremiah Avatar answered Oct 17 '22 12:10

Jeremiah


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.

like image 1
Mehdzor Avatar answered Oct 17 '22 14:10

Mehdzor