DropplinkDocsPowered bydropp.

SDK

Android integration

Install ID, the Play Install Referrer and the init call.

Until the Android SDK ships, integrate with plain HTTPS. It's three steps on every app launch.

  1. Create an install ID

    On first launch, generate a UUID and keep it in SharedPreferences. Never regenerate it: it identifies this install.

  2. Read the install referrer

    On the first launches, read the Play Install Referrer with com.android.installreferrer:installreferrer:2.2. It contains the click_id from the link that sent the user to the Play Store.

    InstallReferrer.kt
    val client = InstallReferrerClient.newBuilder(context).build()
    client.startConnection(object : InstallReferrerStateListener {
        override fun onInstallReferrerSetupFinished(code: Int) {
            if (code == InstallReferrerClient.InstallReferrerResponse.OK) {
                val details = client.installReferrer
                val raw = details.installReferrer // "click_id=c_…&utm_source=instagram&…"
                val clickId = Uri.parse("?$raw").getQueryParameter("click_id")
                // Send raw, clickId, referrerClickTimestampSeconds and installBeginTimestampSeconds
            }
            client.endConnection()
        }
        override fun onInstallReferrerServiceDisconnected() {}
    })

    Send it on every launch until a response comes back with attribution.type = "attributed", then stop.

  3. Call /v1/init

    Send a signed POST https://attribution.ondropp.app/v1/init. See the request and response.

Keys in your app#

Put the SDK key ID (ak_…) and its secret in BuildConfig fields from your CI secrets, not in source control.

build.gradle.kts
buildConfigField("String", "DROPPLINK_KEY_ID", "\"${System.getenv("DROPPLINK_KEY_ID")}\"")
buildConfigField("String", "DROPPLINK_SECRET", "\"${System.getenv("DROPPLINK_SECRET")}\"")

Testing the referrer#

Open https://go.yourbrand.com/<code> on the phone, then install the build from Play internal testing. The Play Store passes the referrer to internal-test installs. A sideloaded APK gets no referrer.

/v1/init currently authenticates and validates every request, and always answers organic. Install attribution and deferred deep links arrive in this same response once they ship, with no change to your integration.

Something unclear? Tell us.Powered bydropp.