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
- User taps a WarpLink URL in Chrome
- WarpLink captures browser signals and sets the Play Install Referrer with
utm_source=warplink&utm_content={link_id} - User is redirected to the Play Store
- User installs and opens the app
- SDK detects first launch (tracked via SharedPreferences)
- SDK reads the Play Install Referrer — if it contains
utm_source=warplink, a deterministic match is made (confidence 1.0) - If the referrer is unavailable, the SDK falls back to fingerprint matching
- Server returns a
WarpLinkDeepLinkwithisDeferred = true
Check for Deferred Deep Links
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
| Scenario | Confidence | Match Type |
|---|---|---|
| Play Install Referrer match | 1.0 | DETERMINISTIC |
| Enriched fingerprint, < 1 hour | 0.85 | PROBABILISTIC |
| Enriched fingerprint, < 24 hours | 0.65 | PROBABILISTIC |
| Enriched fingerprint, < 72 hours | 0.40 | PROBABILISTIC |
| Multiple candidates matched | -0.15 per extra | PROBABILISTIC |
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 installor 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" ... >Multiple Links Before Install
Only the most recent click is matched when a user clicks multiple WarpLink URLs before installing.
Testing
- Uninstall the app from the test device
- Open the test link in Chrome — redirects to the Play Store (or fallback URL)
- Install via Android Studio or
adb install - Launch the app —
checkDeferredDeepLinkshould return the matched deep link