Skip to main content

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 Flutter 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., NewMainActivity).
  • 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?param1=value1&campaign=my_campaign
  • 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 Management > Create Template
  3. Setup Template
    • Save and note the template ID (Required for Dynamic Link)

Implementation

Dart Example

DynamicLink.dart
// Creates a short, shareable dynamic link with attribution and platform fallbacks.
Trackierfluttersdk.createDynamicLink(

// Set the template ID for the link ( Get this id from Apptrove Pannel)
templateId: 'wy23Px',

// Base/fallback URL used in browsers and link previews.
link: 'https://trackier58.u9ilnk.me',

// Your verified/branded dynamic link domain.
domainUriPrefix: 'trackier58.u9ilnk.me',

// In-app route/value used to navigate within your app.
// Handle according to your target activity or screen, or set to 'none' if not applicable.
deepLinkValue: 'CakeActivity',

// Where Android users go if the app isn't installed (Play Store URL).
androidRedirect: 'https://play.google.com/store/apps/details?id=com.trackier.vistmarket',

// Handle your own logic based on these SDK parameters after deep link resolution.
sdkParameters: {
'product_id': 'chocochip',
'quantity': '2',
},

// Attribution parameters for tracking user actions or events.
// you can verify the values later in the approval panel.

attributionParameters: {
'channel': 'my_channel',
'media_source': 'at_invite',
'campaign': 'sanu',
},

// Where iOS users go if the app isn't installed.
iosRedirect: 'https://www.example.com/ios',

// Desktop browser fallback.
desktopRedirect: 'https://trackier.com',

// Social meta for rich previews on social platforms (Open Graph).
socialMeta: {
'title': 'Your Title',
'description': 'Your Description',
'imageLink': 'https://www.example.com/image.jpg',
},
).then((url) {
// Success: use the short URL (log/share/copy to clipboard, etc.)
print('Deep Link URL: $url');
// Example: share the URL
// await Share.share(url);
}).catchError((err) {
// Failure: log/report and optionally show a user-facing message.
print('Failed to create link: $err');
// Example: show a snackbar/toast
// ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('Link creation failed')));
});

Configuration Parameters

Basic Parameters

ParameterTypeDescriptionRequired
templateIdstringUnilink template ID from the Trackier panelYes
linkstringBase/fallback URL used in browsers and previewsYes
domainUriPrefixstringYour verified/branded dynamic link domainYes
deepLinkValuestringApp route/value to navigate after resolvingNo

Platform Fallbacks (Dart snippets)

androidRedirect: 'https://play.google.com/store/apps/details?id=com.example.app', // Android fallback
iosRedirect: 'https://apps.apple.com/app/id123456789', // iOS fallback