Dynamic Link
Dynamic links allow you to direct users to specific in-app content, track campaign performance, and handle platform-specific redirects (e.g., Play Store, iOS, desktop). With the AppTrove Cordova SDK, you can create dynamic links programmatically, embedding attribution and deep link parameters to enhance user acquisition and engagement.
Overview
Dynamic links provide a flexible way to route users based on their platform and context:
- Purpose: Generate links for campaigns, deep linking to specific app content (e.g., product pages).
- Use Case: Create a link like
https://vistmarket.shop/78R2J2
that directs users to a product page with parameters (productid=jeans
) and tracks campaign data (campaign=my_campaign
).
Key Features:
- Deep link to in-app destinations
- Attribution parameters for tracking
- Platform-specific redirects (Android, iOS, desktop)
- Social media previews for sharing
Example Link:
- Generated:
https://vistmarket.shop/78R2J2
- Redirects to:
https://apptrove.com?utm_redirect=sdk_link
or Play Store if app not installed
Configure Trackier Panel
- Log in to the Trackier Panel
- Go to Unilink Management > Create Template
- Setup Template
- Save and note the template ID (Required for Dynamic Link)
Implementation
- Pure Cordova
- Ionic Native
dynamic-link.js
function createDynamicLink() {
const dynamicLinkConfig = {
templateId: "78R2J2", // Get this ID from Trackier Panel
link: "https://apptrove.com?utm_redirect=sdk_link",
domainUriPrefix: "vistmarket.shop",
deepLinkValue: "product_detail?product_id=123",
// Attribution parameters
attributionParameters: {
channel: "my_channel",
campaign: "my_campaign",
mediaSource: "at_invite",
p1: "param1_value",
p2: "param2_value",
p3: "param3_value",
p4: "param4_value",
p5: "param5_value"
},
// Platform-specific parameters
androidParameters: {
redirectLink: "https://play.google.com/store/apps/details?id=com.trackier.vistmarket"
},
iosParameters: {
redirectLink: "https://apps.apple.com/app/id123456789"
},
desktopParameters: {
redirectLink: "https://www.example.com/desktop"
},
// Social media preview settings
socialMetaTagParameters: {
title: "New Offer: Buy 1 Get 2 Free",
description: "New deal is live now.",
imageLink: "https://bluetooth_speaker.jpg"
}
};
TrackierCordovaPlugin.createDynamicLink(dynamicLinkConfig)
.then(function(dynamicLinkUrl) {
console.log("Dynamic link created:", dynamicLinkUrl);
})
.catch(function(error) {
console.error("Error creating dynamic link:", error);
});
}
dynamic-link.page.ts
import { Component } from '@angular/core';
import { TrackierCordovaPlugin } from '@awesome-cordova-plugins/trackier/ngx';
@Component({
selector: 'app-dynamic-link',
templateUrl: 'dynamic-link.page.html'
})
export class DynamicLinkPage {
constructor(private trackierCordovaPlugin: TrackierCordovaPlugin) {}
async createDynamicLink() {
const dynamicLinkConfig = {
templateId: "78R2J2", // Get this ID from Trackier Panel
link: "https://apptrove.com?utm_redirect=sdk_link",
domainUriPrefix: "vistmarket.shop",
deepLinkValue: "product_detail?product_id=123",
// Attribution parameters
attributionParameters: {
channel: "my_channel",
campaign: "my_campaign",
mediaSource: "at_invite",
p1: "param1_value",
p2: "param2_value",
p3: "param3_value",
p4: "param4_value",
p5: "param5_value"
},
// Platform-specific parameters
androidParameters: {
redirectLink: "https://play.google.com/store/apps/details?id=com.trackier.vistmarket"
},
iosParameters: {
redirectLink: "https://apps.apple.com/app/id123456789"
},
desktopParameters: {
redirectLink: "https://www.example.com/desktop"
},
// Social media preview settings
socialMetaTagParameters: {
title: "New Offer: Buy 1 Get 2 Free",
description: "New deal is live now.",
imageLink: "https://bluetooth_speaker.jpg"
}
};
try {
const dynamicLinkUrl = await this.trackierCordovaPlugin.createDynamicLink(dynamicLinkConfig);
console.log("Dynamic link created:", dynamicLinkUrl);
} catch (error) {
console.error("Error creating dynamic link:", error);
}
}
}
Configuration Parameters
Basic Parameters
Parameter | Type | Description | Required |
---|---|---|---|
templateId | string | Your dynamic link template ID from Trackier Panel | Yes |
link | string | The base URL for your dynamic link | Yes |
domainUriPrefix | string | Your domain URI prefix | Yes |
deepLinkValue | string | Custom deep link value for in-app navigation | No |
Platform Parameters
Android Parameters
androidParameters: {
redirectLink: "https://play.google.com/store/apps/details?id=com.example.app"
}
iOS Parameters
iosParameters: {
redirectLink: "https://apps.apple.com/app/id123456789"
}
Desktop Parameters
desktopParameters: {
redirectLink: "https://yourdomain.com/desktop"
}
Social Media Parameters
socialMetaTagParameters: {
title: "Your App Title",
description: "Description for social media sharing",
imageLink: "https://example.com/image.jpg"
}
SDK Parameters
sdkParameters: {
param1: "value1",
param2: "value2",
param3: "value3"
}
Attribution Parameters
attributionParameters: {
channel: "social", // Marketing channel
campaign: "summer_sale", // Campaign name
mediaSource: "facebook", // Media source
p1: "custom_param1", // Custom parameter 1
p2: "custom_param2", // Custom parameter 2
p3: "custom_param3", // Custom parameter 3
p4: "custom_param4", // Custom parameter 4
p5: "custom_param5" // Custom parameter 5
}
Best Practices
Do's
- Test thoroughly on both Android and iOS platforms
- Use meaningful deep link values for better user experience
- Include social media metadata for better sharing experience
- Set appropriate redirect links for each platform
- Use SDK parameters for enhanced analytics
- Handle errors gracefully with proper error handling
Don'ts
- Don't forget to configure the template in Trackier Panel first
- Don't use invalid or malformed URLs
- Don't skip platform-specific configurations
- Don't ignore error handling
- Don't hardcode sensitive information in parameters
Troubleshooting
Common Issues & Solutions
Issue | Solution |
---|---|
Dynamic link creation fails | Verify template ID is correct and exists in Trackier Panel |
Invalid template ID error | Check that the template is properly configured in Trackier Panel |
Platform redirects not working | Ensure redirect links are valid and accessible |
Social media preview not showing | Verify image links are accessible and properly formatted |
Deep link not opening app | Check deep link configuration and app URL scheme setup |