Deferred Deep Linking
Choose your SDK version below:
- Apptrove SDK → Recommended for all projects (Latest: v2.x.x)
- Trackier SDK → Will be deprecated in August 2026 (Latest legacy: v1.x.xx)
Use the tabs below for SDK-specific snippets.
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.
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
- ✓ Apptrove SDK (Recommended)
- Trackier SDK (Deprecating August 2026)
import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
import { AppTroveCordovaPlugin, AppTroveConfig, AppTroveEnvironment } from 'com.apptrove.cordova_sdk/ionic-native/apptrove/ngx';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
})
export class AppComponent {
constructor(
private platform: Platform,
private apptroveCordovaPlugin: AppTroveCordovaPlugin
) {
this.initializeApp();
}
async initializeApp() {
await this.platform.ready();
await this.initializeAppTroveSDK();
}
async initializeAppTroveSDK() {
try {
const appTroveConfig = new AppTroveConfig(
'YOUR_SDK_KEY',
AppTroveEnvironment.Production
);
// 1. Set up deferred deep link listener BEFORE SDK initialization
this.apptroveCordovaPlugin.setDeferredDeeplinkCallbackListener().subscribe({
next: (uri: string) => {
console.log('Deferred Deep Link URL:', uri);
this.handleDeepLink(uri);
},
error: (error) => {
console.error('Deferred deep link listener error:', error);
}
});
// 2. Initialize SDK
await this.apptroveCordovaPlugin.initializeSDK(appTroveConfig);
console.log('AppTrove SDK initialized successfully');
// 3. Subscribe to attribution link for deferred deep links (iOS only)
if (this.platform.is('ios')) {
this.apptroveCordovaPlugin.subscribeAttributionlink();
}
} catch (error) {
console.error('Error initializing AppTrove 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]);
}
}
import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
import { TrackierCordovaPlugin, TrackierConfig, TrackierDeepLink } 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 = new TrackierConfig(
'YOUR_SDK_KEY',
'production'
);
// 1. Set up deferred deep link listener BEFORE SDK initialization
this.trackierCordovaPlugin.setDeferredDeeplinkCallbackListener().subscribe({
next: (deepLink: TrackierDeepLink) => {
console.log('Deferred Deep Link received');
console.log('URL:', deepLink.url);
console.log('Is Deferred:', deepLink.isDeferred);
console.log('Deep Link Value:', deepLink.deepLinkValue);
console.log('Partner ID:', deepLink.partnerId);
console.log('Campaign:', deepLink.campaign);
console.log('Campaign ID:', deepLink.campaignId);
console.log('Ad:', deepLink.ad);
console.log('Ad Set:', deepLink.adSet);
console.log('Channel:', deepLink.channel);
console.log('P1-P5:', deepLink.p1, deepLink.p2, deepLink.p3, deepLink.p4, deepLink.p5);
if (deepLink.sdkParams) {
console.log('SDK Params:', JSON.stringify(deepLink.sdkParams));
}
this.handleDeepLink(deepLink);
},
error: (error) => {
console.error('Deferred deep link listener error:', error);
}
});
// 2. Initialize SDK
await this.trackierCordovaPlugin.initializeSDK(trackierConfig);
console.log('Trackier SDK initialized successfully');
// 3. Subscribe to attribution link (iOS only)
if (this.platform.is('ios')) {
this.trackierCordovaPlugin.subscribeAttributionlink();
}
} catch (error) {
console.error('Error initializing Trackier SDK:', error);
}
}
handleDeepLink(deepLink: TrackierDeepLink) {
console.log('Handling deep link:', deepLink.url);
// Directly access object properties without manual parsing
if (deepLink.deepLinkValue) {
console.log('Value:', deepLink.deepLinkValue);
}
}
}
If you are upgrading from v1.6.80 or earlier, the callback previously returned a plain URL string. In v1.6.81+, it returns a structured TrackierDeepLink object. Update your callback handler to use the new object properties instead of parsing the URL manually.
Before (v1.6.80):
observable.subscribe((uri: string) => {
console.log('Deep link URL:', uri);
});
After (v1.6.81+):
observable.subscribe((deepLink: TrackierDeepLink) => {
console.log('Deep link URL:', deepLink.url);
console.log('Deep link value:', deepLink.deepLinkValue);
});
2. Deep Link Data Structure
The enhanced callback provides a comprehensive TrackierDeepLink object (for Trackier SDK v1.6.81+) with the following structure:
{
url: "https://trackier58.u9ilnk.me/d/NKmWH9E7b1",
isDeferred: true,
deepLinkValue: "product",
partnerId: "12345",
campaign: "summer_sale",
sdkParams: {
"custom_key": "custom_value"
}
}
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 Apptrove Panel |
| Deep link not processed | Ensure subscribeAttributionlink() is called after SDK initialization |
| Callback not triggered | Ensure listener is configured before initializeSDK() |
| Missing parameters | Verify URL includes required parameters |
Trackier SDK Specific Issues:
| Issue | Solution |
|---|---|
| Callback returns string instead of object | Update SDK to v1.6.81+ — older versions return plain URL string |
For further assistance, contact Apptrove support at support@apptrove.com.