Docs
Google Play install referrer without an SDK
Last updated
Jumper adds referrer=jumper%3D<link id>%26campaign%3D<name> to every Google Play address. 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 a campaign on the Jumper link. Jumper adds a referrer to every Google Play address it sends: jumper=<link id>, plus campaign=<name> when you set one. 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. 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. "jumper=lnk_abc123&campaign=summer-launch"
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("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.