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
For iOS Only: 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. For Android, deferred deep linking works automatically without this call.
Implementation
1. Initialize SDK with Deferred Deep Link Callback
app.component.ts
import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
import { TrackierCordovaPlugin, TrackierConfig } from '@awesome-cordova-plugins/trackier/ngx';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
})
export class AppComponent {
constructor(
private platform: Platform,
private trackierCordovaPlugin: TrackierCordovaPlugin
) {
this.initializeApp();
}
async initializeApp() {
await this.platform.ready();
await this.initializeTrackierSDK();
}
async initializeTrackierSDK() {
try {
const trackierConfig: TrackierConfig = {
appToken: 'YOUR_SDK_KEY',
environment: 'production'
};
// Set deferred deep link callback
trackierConfig.deferredDeeplinkCallback = (uri: string) => {
console.log('Deferred Deep Link URL:', uri);
// Handle your deep link navigation here
this.handleDeepLink(uri);
};
await this.trackierCordovaPlugin.initializeSDK(trackierConfig);
console.log('Trackier SDK initialized successfully');
// Subscribe to attribution link for deferred deep links (iOS only)
if (this.platform.is('ios')) {
this.trackierCordovaPlugin.subscribeAttributionlink();
}
} catch (error) {
console.error('Error initializing Trackier SDK:', error);
}
}
handleDeepLink(uri: string) {
// Parse the deep link and navigate to appropriate screen
console.log('Handling deep link:', uri);
// Example: this.router.navigate(['/product', productId]);
}
}
Testing
Android Testing
- Prepare APK: Build APK with SDK integration
- Click Link: Open test URL in browser - redirects to Play Store
- Install APK: Install APK manually (not from Play Store)
- Launch App: Open app - deferred deep link should be processed
iOS Testing
- Prepare IPA: Build IPA with SDK integration
- Click Link: Open test URL in Safari - redirects to App Store
- Install App: Install via TestFlight or direct installation
- Launch App: Open app - deferred deep link should be processed
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 |
| Deep link not processed | Ensure subscribeAttributionlink() is called after SDK initialization |
| Missing parameters | Verify URL includes required parameters |
For further assistance, contact Trackier support at support@trackier.com.