RevenueCat data integration into Google Firebase Analytics

  • 14 September 2021
  • 15 replies
  • 447 views

Badge +2

Hi everyone,

I am afraid the answer to this question is No but in case this ever changes in the future I am still asking it.

Is it possible to export/integrate RevenueCat collected data into Google Firebase Analytics?

Thanks in advance for your reply.


15 replies

Userlevel 5
Badge +9

I don’t think it’s possible to integrate directly since there isn’t a REST API to hook into Firebase Analytics - only device side tracking.

 

I would also love to know if anyone has found any creative solutions.

 

The best thing I know is to export the Firebase Analytics to Big Query, then set up a RevenueCat ETL to Google storage which you can also send into Big Query. 

Badge +2

As of late 2020 it is possible to log events from server-side code with the Analytics Data API and the GA4 Measurement Protocol documentation on sending events with this REST API, which you can use from Cloud Functions (and almost any other environment).

 

https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=firebase

 

The appInstanceID would need to be passed through somehow, possibly using RevenueCat Subscriber Attributes, or more directly, with a firebase collection that maps user_id to an appInstanceID.  It’s also possible that one valid appInstanceID could be used for all requests since user_id is a separate parameter to the REST API.  I’ll try and report back.

Userlevel 1
Badge +5

:fingers_crossed: It would be really useful to see the integration of RC sending events to Google Analytics / GA4!  Since we use RC as the source of truth for subscriptions and entitlements this is really a needed and useful connection.  Can this happen sometime soon?

 

Userlevel 4
Badge +7

Just an update here that this is something that we are actively exploring right now; expect more news in the next few months.

Badge +4

Just an update here that this is something that we are actively exploring right now; expect more news in the next few months.

Jens, any updates on this? I’ve created Firebase integration but still do not see events on Google Analytics side. Do you have any requirements for minimum SDK version that can properly support this functionality. So far I see that firebase app instance id is passed via subscriber attributes, so additional  client code is not required. I use Flutter SDK 2.0.3

Userlevel 4
Badge +7

Just an update here that this is something that we are actively exploring right now; expect more news in the next few months.

Jens, any updates on this? I’ve created Firebase integration but still do not see events on Google Analytics side. Do you have any requirements for minimum SDK version that can properly support this functionality. So far I see that firebase app instance id is passed via subscriber attributes, so additional  client code is not required. I use Flutter SDK 2.0.3

Hi Anastasiia, we have identified an issue where sometimes analytics events do not get delivered to Firebase and we are working on a fix. Expect to receive communication when this has been fixed.

 

CC @tina 

Userlevel 5
Badge +10

Hey @Anastasiia Stepanova 

A fix has been deployed last week, you should start seeing events populating in Google Analytics now. Check out the Realtime view to confirm you’re receiving events. Let us know if there’s any issues!

Badge +4

Hey @tina @Jens 

I am glad to hear updates from you, but I still do not see RC events on my Google Analytics dashboard. I’ve reported about this issue to my email thread with support team, hope we will be able to understand where is the issue.

Badge +4

The issue was in Google Analytics app instance id, it is not the same as Firebase app instance id.

  • Google Analytics app instance id is 32 HEX like this 9247fac65b9e4e76710904ae59ff0469
  • Firebase app instance id looks is 22 long like this Eol2-beETE-_cfkgTCswiQ

As soon as we’ve provided Google Analytics app instance id, RC events were displayed in the Google Analytics dashboard.

The issue was in Google Analytics app instance id, it is not the same as Firebase app instance id.

  • Google Analytics app instance id is 32 HEX like this 9247fac65b9e4e76710904ae59ff0469
  • Firebase app instance id looks is 22 long like this Eol2-beETE-_cfkgTCswiQ

As soon as we’ve provided Google Analytics app instance id, RC events were displayed in the Google Analytics dashboard.

How you get Google Analytics app instance id?

Badge +4

I know that it looks strange, my expectation was that Firebase app instance id is used everywhere in Firebase/Google ecosystem… I should note that I use not the latest libraries to get Firebase instance id, but they are not too old. I have checked this on pure Android Java implementation and get different ids by invoking two pieces of code:

 

Firebase app instance id:

FirebaseInstallations.getInstance().getId().addOnCompleteListener(new OnCompleteListener<String>() {    @Override    public void onComplete(@NonNull com.google.android.gms.tasks.Task<String> task) {            String appInstanceId= task.getResult();    }});

 

Google Analytics app instance id:

FirebaseAnalytics.getInstance(this).getAppInstanceId().addOnCompleteListener(new OnCompleteListener<String>() {    @Override    public void onComplete(@NonNull com.google.android.gms.tasks.Task<String> task) {            String appInstanceId = task.getResult();    }});

As for flutter I use 1.22.6, thus I had to write platform specific native code to get Google Analytics app instance id. I used this great library as a source:

https://github.com/cingulo/firebase_instance_id

I know that it looks strange, my expectation was that Firebase app instance id is used everywhere in Firebase/Google ecosystem… I should note that I use not the latest libraries to get Firebase instance id, but they are not too old. I have checked this on pure Android Java implementation and get different ids by invoking two pieces of code:

 

Firebase app instance id:

FirebaseInstallations.getInstance().getId().addOnCompleteListener(new OnCompleteListener<String>() {    @Override    public void onComplete(@NonNull com.google.android.gms.tasks.Task<String> task) {            String appInstanceId= task.getResult();    }});

 

Google Analytics app instance id:

FirebaseAnalytics.getInstance(this).getAppInstanceId().addOnCompleteListener(new OnCompleteListener<String>() {    @Override    public void onComplete(@NonNull com.google.android.gms.tasks.Task<String> task) {            String appInstanceId = task.getResult();    }});

As for flutter I use 1.22.6, thus I had to write platform specific native code to get Google Analytics app instance id. I used this great library as a source:

https://github.com/cingulo/firebase_instance_id

Thanks!

Badge +4

Just for reference in case someone face the same problem with using correct firebase analytics app instance id - https://stackoverflow.com/questions/62990995/what-is-the-difference-between-app-instance-id-and-instance-id-in-firebase

Badge +3

Just an update here that this is something that we are actively exploring right now; expect more news in the next few months.

Jens, any updates on this? I’ve created Firebase integration but still do not see events on Google Analytics side. Do you have any requirements for minimum SDK version that can properly support this functionality. So far I see that firebase app instance id is passed via subscriber attributes, so additional  client code is not required. I use Flutter SDK 2.0.3

Hi @Anastasiia Stepanova , how were you able to setup GA integration with Revenuecat? I was following this document but the code example is for iOS/Swift. We’re also developing our app with flutter and used the purchases_flutter package by revenuecat, but I can’t find the equivalent method in the package for this line of code:

Purchases.shared.attribution.setFirebaseAppInstanceID(unwrapped)

 

Badge +4

@penlab_kumu I provided example of native code that I used on Android side to get correct instance id. Read this thread. You should use this:

 

FirebaseAnalytics.getInstance(this).getAppInstanceId().addOnCompleteListener(new OnCompleteListener<String>() {    @Override    public void onComplete(@NonNull com.google.android.gms.tasks.Task<String> task) {            String appInstanceId = task.getResult();    }});

Reply