Deferred Deep Linking
Deferred deep linking happens when a user clicks a Trackier URL but doesn't have your app installed. The URL redirects to the App Store, and when the user installs and opens the app, the SDK retrieves the deep link data.
note
To enable deferred deep link functionality on iOS, you need to call the subscribeAttributionlink()
method after initialization. This allows our server to send the attributed data parameters to the app.
Prerequisites
- iOS 10.0 or later
- AppTrove SDK integrated and initialized
- Associated Domains configured in Xcode
Implementation
1. Configure Associated Domains
In Xcode, add your UniLink subdomain to Associated Domains:
- Go to Capabilities tab
- Turn on Associated Domains
- Add:
applinks:yourbrand.unilink.me
2. Initialize SDK with Deep Link Listener
AppDelegate.swift
import UIKit
import trackier_ios_sdk
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, DeepLinkListener {
func onDeepLinking(result: DeepLink) -> Void {
print("Deep link data: \(result.getUrlParams())")
// Handle your deep link navigation here
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let config = TrackierSDKConfig(
appToken: "xxxx-xx-xxx-xxx",
env: TrackierSDKConfig.ENV_DEVELOPMENT
)
config.setDeeplinkListerner(listener: self)
TrackierSDK.initialize(config: config)
// Subscribe to attribution link for deferred deep links
if #available(iOS 13.0.0, *) {
TrackierSDK.subscribeAttributionlink()
}
return true
}
}
3. Access Deep Link Parameters
func onDeepLinking(result: DeepLink) -> Void {
print("URL: \(result.getUrl())")
print("SDK Params: \(result.getSDKParams())")
print("Ad: \(result.getAd())")
print("Ad ID: \(result.getAdId())")
print("Campaign: \(result.getCamp())")
print("Campaign ID: \(result.getCampId())")
print("Ad Set: \(result.getAdSet())")
print("Ad Set ID: \(result.getAdSetId())")
print("Channel: \(result.getChannel())")
print("Click ID: \(result.getClickId())")
print("DLV: \(result.getDlv())")
print("PID: \(result.getPid())")
print("Message: \(result.getMessage())")
print("P1: \(result.getP1())")
print("P2: \(result.getP2())")
print("P3: \(result.getP3())")
print("P4: \(result.getP4())")
print("P5: \(result.getP5())")
}
Testing
Test Deferred Deep Link
- Prepare Test URL: Get a valid deferred deep link from AppTrove panel
- Click the Link: Open the link in Safari - it should redirect to App Store
- Install App: Install the app (via TestFlight or direct installation)
- Launch App: Open the app - the SDK should process the deferred deep link
- Verify: Check that
onDeepLinking
is called with the correct parameters
Example Test URL:
https://yourdomain.u9ilnk.me/d/Af2xeLPI77?pid=Ron+Media+Source&cost_value=0&cost_currency=GBP&lbw=1d&camp=Ron+Referral+Test&dlv=RonTestClass&p2=param_2_value&sdk_param=sdk_param_value
Common Issues
Issue | Solution |
---|---|
No App Store redirect | Check Store Redirect in Trackier Panel |
Deferred link not working | Call subscribeAttributionlink() after SDK initialization |
Missing parameters | Verify URL includes required parameters |
For further assistance, contact Trackier support at support@trackier.com.