Firebase

Send in-app subscription data to Firebase

Qonversion can send revenue events, including purchases, trial conversions, subscription renewals, and even refunds, to your Firebase account. This allows you to match your users' behaviour with their payment history in Firebase and empower your product decisions.

1. Setup the SDKs

  1. Make sure you have Firebase SDK installed. Check the official Firebase SDK documentation here
  2. Set Qonversion SDK following Installing the SDKs guides.
  3. Send firebaseAppInstanceId to Qonversion via User Properties
if let appInstanceID = Analytics.appInstanceID() {
    Qonversion.setProperty(.firebaseAppInstanceId, value: appInstanceID)
}
[Qonversion setProperty:QNPropertyFirebaseAppInstanceId value:[FIRAnalytics appInstanceID]];
FirebaseAnalytics.getInstance(context).getAppInstanceId().addOnCompleteListener(task -> {
    final String appInstanceId = task.getResult();
    if (appInstanceId != null) {
      Qonversion.setProperty(QUserProperties.FirebaseAppInstanceId, appInstanceId);
    }
});
FirebaseAnalytics.getInstance(requireContext()).appInstanceId.addOnCompleteListener { task ->
    task.result?.let { appInstanceId ->
        setProperty(QUserProperties.FirebaseAppInstanceId, appInstanceId)
    }
}
Qonversion.setProperty(QUserProperty.firebaseAppInstanceId, appInstanceId);
Qonversion.setProperty(Property.FIREBASE_APP_INSTANCE_ID, appInstanceId);
Qonversion.SetProperty(UserProperty.FirebaseAppInstanceId, appInstanceId);

🚧

Measurement app_instance_id is expected to be a 32-digit hexadecimal number.

2. Configure the Firebase Integration

  1. Copy your Firebase App ID and Measurement Protocol API secret from the Google Analytics Console: Admin → Data Streams → Select existing or create a new stream for your App
24222422

App data stream details page

  1. Navigate to the Tools → Integrations section in your Qonversion account
  2. Choose your platform (IOS or Android) and click the Add new + button and select Firebase
  3. Provide the API Secret and App ID copied in the first step to the corresponding fields
24162416

Qonversion Firebase integration setting screen

3. Pay attention to event names

Event names:

  • Must be 40 characters or fewer
  • May only contain alpha-numeric characters and underscores
  • Must start with an alphabetic character.

Names

👍

Done

Qonversion will send In-App purchases and subscription events to your Firebase account. You can make changes to event names and other setting on the Firebase integration settings page in Qonversion.


Did this page help you?