Use multiple firebase accounts in single android app for google analytics

Viewed 6406

I have a use case in which 1 app will be used by multiple separate companies (franchises) that will have their own marketing and management teams. I need the user to select a franchise when the mobile app starts up, and then from that point on, push all analytics data to that franchise's firebase (google analytics) account. Similarly any push notifications that are sent from that franchise's servers need to go to the user.

Is this configuration possible? In the past I used to set up a google analytics account for each franchise and just download the UA-xxx number from the server on franchise selection, and then set up the google analytics object based on that..

What is the appropriate way to achieve this via firebase connected to google analytics ?

I found the offical API reference: https://firebase.google.com/docs/configure/ This link explains how to do it for iOS but doesn't mention how to do it in android. It does say however that the firebase init runs before user code.. perhaps that means it is not possible?

Here is the init provider they mention: https://firebase.google.com/docs/reference/android/com/google/firebase/provider/FirebaseInitProvider

2 Answers
Related