WarpLink
SDKsAndroid

Deferred Deep Links

Preserve link context through Play Store installs on Android.

Deferred deep links let you route users to specific content even when they don't have your app installed. The user clicks a link, installs from the Play Store, and on first launch the SDK matches them back to the original link.

How It Works

  1. User taps a WarpLink URL in Chrome
  2. WarpLink captures browser signals and sets the Play Install Referrer with utm_source=warplink&utm_content={link_id}
  3. User is redirected to the Play Store
  4. User installs and opens the app
  5. SDK detects first launch (tracked via SharedPreferences)
  6. SDK reads the Play Install Referrer — if it contains utm_source=warplink, a deterministic match is made (confidence 1.0)
  7. If the referrer is unavailable, the SDK falls back to fingerprint matching
  8. Server returns a WarpLinkDeepLink with isDeferred = true
WarpLink.checkDeferredDeepLink { result ->
    result.onSuccess { deepLink ->
        if (deepLink == null) {
            showOnboarding()
            return@onSuccess
        }

        val confidence = deepLink.matchConfidence ?: 0.0

        if (confidence > 0.5) {
            val target = deepLink.deepLinkUrl ?: deepLink.destination
            navigateTo(target)
        } else {
            showWelcome(suggestedContent = deepLink.destination)
        }
    }.onFailure { error ->
        Log.e("MyApp", "Deferred deep link error: ${error.message}")
        showOnboarding()
    }
}

Confidence Scores

ScenarioConfidenceMatch Type
Play Install Referrer match1.0DETERMINISTIC
Enriched fingerprint, < 1 hour0.85PROBABILISTIC
Enriched fingerprint, < 24 hours0.65PROBABILISTIC
Enriched fingerprint, < 72 hours0.40PROBABILISTIC
Multiple candidates matched-0.15 per extraPROBABILISTIC

Recommendation: Route to specific content when matchConfidence > 0.5. Show generic onboarding below 0.5.

Match Window

WarpLink.configure(
    context = this,
    apiKey = "wl_live_your_api_key_here_abcdefgh",
    options = WarpLinkOptions(matchWindowHours = 48)
)

Caching Behavior

  • Attribution check happens once per install (first launch only)
  • Result is cached in SharedPreferences
  • Subsequent calls return the cached result without a network request

Edge Cases

Play Install Referrer Unavailable

The referrer is the primary matching method but is unavailable when:

  • The app is sideloaded (adb install or direct APK)
  • No Google Play Services (e.g., Huawei HMS devices)
  • Referrer data has expired

The SDK automatically falls back to fingerprint matching. No code changes needed.

Offline First Launch

If the device has no connectivity on first launch, checkDeferredDeepLink fails with WarpLinkError.NetworkError. The first-launch flag is consumed, so retrying later returns cached null.

SharedPreferences Persistence on Reinstall

Android may preserve SharedPreferences across uninstall/reinstall if Auto Backup is enabled. To prevent stale attribution data:

<!-- res/xml/backup_rules.xml -->
<full-backup-content>
    <exclude domain="sharedpref" path="warplink_prefs.xml" />
</full-backup-content>
<!-- AndroidManifest.xml -->
<application android:fullBackupContent="@xml/backup_rules" ... >

Only the most recent click is matched when a user clicks multiple WarpLink URLs before installing.

Testing

  1. Uninstall the app from the test device
  2. Open the test link in Chrome — redirects to the Play Store (or fallback URL)
  3. Install via Android Studio or adb install
  4. Launch the app — checkDeferredDeepLink should return the matched deep link

On this page