Skip to main content
Version: SDK 6.0.x

Integrate with Firebase

If you're using the Firebase SDK alongside the justtrack SDK, you can use the justtrack SDK to send a user's Firebase App Instance ID to the justtrack backend. Later, the justtrack backend can forward events to Firebase, allowing you to measure events happening outside your app. To enable this, the justtrack backend needs the user's Firebase App Instance ID.

We provide two approaches for integrating Firebase SDK with justtrack SDK.

Before you begin

Please review the following compatibility matrix to make sure you're using compatible versions:

justtrack SDKFirebase AdapterFirebase BOM
6.0.0+1.x29.x.

Option 1: Provide Firebase App Instance ID directly

// During SDK initialization
val sdk = new JustTrackSdkBuilder(this, API_TOKEN)
.setFirebaseAppInstanceId("... provide user's Firebase app instance ID here")
.build()

// Or after...
sdk.setFirebaseAppInstanceId("... provide user's Firebase app instance ID here")

Option 2: Integrate with Firebase

First, add the adapter dependency to your package manager:

dependencies {
implementation("io.justtrack:adapter-firebase:1.0.0")
}

Then, initialize the adapter, and integrate it with the justtrack SDK:

import io.justtrack.integrations.firebase.FirebaseIntegrationAdapter

// Integrate the adapter while you build the SDK
val sdk = JustTrackSdkBuilder(this, API_TOKEN)
.addIntegrationAdapters(FirebaseIntegrationAdapter())
.build()

// Or after...
sdk.integrateWith(FirebaseIntegrationAdapter())