Skip to main content

Dynamic Link

SDK Version Selection

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.

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
  • Generated: https://vistmarket.shop/78R2J2
  • Redirects to: https://apptrove.com?utm_redirect=sdk_link or Play Store if app not installed

Configure Apptrove Panel

  1. Log in to the Apptrove Panel
  2. Go to UniLink ManagementCreate Template
  3. Set up the template
    • Save and note the template ID (Required for Dynamic Link)

Implementation

Pure Cordova (JavaScript)

note

In pure Cordova projects, the plugin APIs are exposed as globals after deviceready.

www/js/dynamic-link.js
function createDynamicLink() {
const dynamicLinkConfig = {
templateId: "78R2J2", // Get this ID from Apptrove Panel
link: "https://yourapp.example/deeplink",
domainUriPrefix: "yourdomain.u9ilnk.me",
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.yourapp"
},
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://example.com/preview.jpg"
}
};

AppTroveCordovaPlugin.createDynamicLink(dynamicLinkConfig)
.then(function (dynamicLinkUrl) {
console.log("Dynamic link created:", dynamicLinkUrl);
})
.catch(function (error) {
console.error("Error creating dynamic link:", error);
});
}

Ionic Native (Angular)

dynamic-link.page.ts
import { Component } from '@angular/core';
import { AppTroveCordovaPlugin } from 'com.apptrove.cordova_sdk/ionic-native/apptrove/ngx';

@Component({
selector: 'app-dynamic-link',
templateUrl: 'dynamic-link.page.html'
})
export class DynamicLinkPage {
constructor(private apptroveCordovaPlugin: AppTroveCordovaPlugin) {}

async createDynamicLink() {
const dynamicLinkConfig = {
templateId: "78R2J2", // Get this ID from Apptrove Panel
link: "https://yourapp.example/deeplink",
domainUriPrefix: "yourdomain.u9ilnk.me",
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.yourapp"
},
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://example.com/preview.jpg"
}
};

try {
const dynamicLinkUrl = await this.apptroveCordovaPlugin.createDynamicLink(dynamicLinkConfig);
console.log("Dynamic link created:", dynamicLinkUrl);
} catch (error) {
console.error("Error creating dynamic link:", error);
}
}
}

Configuration Parameters

Basic Parameters

ParameterTypeDescriptionRequired
templateIdstringYour dynamic link template ID from Apptrove PanelYes
linkstringThe base URL for your dynamic linkYes
domainUriPrefixstringYour domain URI prefixYes
deepLinkValuestringCustom deep link value for in-app navigationNo

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 Apptrove 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

IssueSolution
Dynamic link creation failsVerify template ID is correct and exists in Apptrove Panel
Invalid template ID errorCheck that the template is properly configured in Apptrove Panel
Platform redirects not workingEnsure redirect links are valid and accessible
Social media preview not showingVerify image links are accessible and properly formatted
Deep link not opening appCheck deep link configuration and app URL scheme setup