Docs
Google Play install referrer without an SDK
Last updated
Jumper adds an install referrer in UTM form, utm_source=<channel>&utm_medium=<medium>&utm_campaign=<campaign>&jumper=<link id> (URL-encoded), to every Google Play address. Firebase Analytics reads it without any code; otherwise your app reads it once after install with Google’s Install Referrer library, about 30 lines of Kotlin, and learns which link and campaign brought the install.
Read the Jumper.to install referrer in your Android app
- Set the channel and campaign on the install link. Jumper adds a referrer in UTM form to every Google Play address it sends: utm_source (the channel, else jumper), utm_medium (else link), utm_campaign (else your app name), utm_content when set, and jumper=<link id>. Firebase Analytics reads it as is. The whole value is URL-encoded and at most 512 characters.
- Add the Install Referrer library. Add com.android.installreferrer:installreferrer:2.2 to your app’s Gradle dependencies. It is Google’s own library and sends nothing to us.
- Read the referrer on first launch. With Firebase Analytics nothing more is needed: it attributes the install to the utm values. Without it, call the function below once, the first time the app opens. It returns the Jumper link id and the campaign, or null when the install did not come from a Jumper link.
- Use it in your own analytics. Pass the link id and campaign to your analytics tool, or ignore them: Jumper’s own click counts do not depend on your app.
Gradle
implementation("com.android.installreferrer:installreferrer:2.2") Kotlin
import android.content.Context
import android.net.Uri
import com.android.installreferrer.api.InstallReferrerClient
import com.android.installreferrer.api.InstallReferrerStateListener
data class JumperReferrer(val linkId: String?, val campaign: String?)
/** Reads the Jumper referrer once after install. Calls back with null if there is none. */
fun readJumperReferrer(context: Context, onResult: (JumperReferrer?) -> Unit) {
val client = InstallReferrerClient.newBuilder(context).build()
client.startConnection(object : InstallReferrerStateListener {
override fun onInstallReferrerSetupFinished(code: Int) {
var result: JumperReferrer? = null
if (code == InstallReferrerClient.InstallReferrerResponse.OK) {
// e.g. "utm_source=yt&utm_medium=description&utm_campaign=summer-launch&jumper=lnk_abc123"
val raw = client.installReferrer.installReferrer
val query = Uri.parse("https://example.invalid/?$raw")
val linkId = query.getQueryParameter("jumper")
if (linkId != null) {
result = JumperReferrer(linkId, query.getQueryParameter("utm_campaign"))
}
}
client.endConnection()
onResult(result)
}
override fun onInstallReferrerServiceDisconnected() {}
})
}
The campaign is cut to fit the 512-character limit of the encoded value. The referrer is part of the address Google Play shows to the visitor; do not put anything private in a campaign name. For the Apple side see Apple campaign tokens.
Questions
Does the referrer survive the install?
Yes. Google Play keeps it for the install and hands it to your app through the Install Referrer API, normally for 90 days after the install.
What if the visitor opens the link inside Instagram or TikTok?
Jumper keeps the referrer in the Android intent and in the Google Play address it falls back to, so the install is attributed the same way.
Do I have to read the referrer?
No. It costs nothing to leave it unread. Reading it only helps you tell which campaign led to an install.