🦋 Generate Dynamic Links in Unity
This guide covers how to create a Dynamic Link directly from your Unity app.
🛠 Prerequisites
Before generating links, ensure:
- Configure ChottuLink Dashboard
- Set up your project
- Configure iOS app settings
- Configure Android app settings
- Get your API key
- Add ChottuLink Unity SDK
- Using
.unitypackage(recommended)
- Using
- Initialize ChottuLink Unity SDK
- Add initialization code to start() method
🔗 Build a Dynamic Link
/// ✅ Create dynamic link parameters
CLDynamicLinkParameters parameter = new CLDynamicLinkParameters();
// Mandatory Parameters
parameter.domain = "yourapp.chottu.link"; // Your ChottuLink domain
parameter.link = "https://example.com"; // Target deep link
// Optional metadata
parameter.androidBehaviour = CLDynamicLinkBehaviour.App;
parameter.iosBehaviour = CLDynamicLinkBehaviour.App;
parameter.linkName = "LinkName";
parameter.selectedPath = "customPath"; // Optional: Customize the URL path
// UTM Tracking (for analytics)
parameter.utmCampaign = "exampleCampaign";
parameter.utmMedium = "exampleMedium";
parameter.utmSource = "exampleSource";
parameter.utmContent = "exampleContent";
parameter.utmTerm = "exampleTerm";
// Social Media Parameters
parameter.socialTitle = "Social Title";
parameter.socialDescription = "Description to show when shared";
parameter.socialImageUrl = "https://yourdomain.com/image.png"; // Must be a valid image URL
🧬 Create the Link
ChottuLink.CreateDynamicLink(parameter, link => {
Debug.Log("✅ Shared Link: "+link); // 🔗 Successfully created link
}, error => {
Debug.Log("❌ Error creating link: "+error);
});
info
- Default behavior is set to
CLDynamicLinkBehaviour.Appfor both platforms selectedPathis optional - if not provided, a random path will be generatedSocialParametersis optional - enhances link previews when sharedUTMParametersis optional - helps track campaign performance
💡 Best Practices
- Always provide a valid destination URL
- Use meaningful link names for better organization
- Set appropriate platform behaviors
- Include UTM parameters for tracking
- Add social parameters for better sharing
- Test links on both iOS and Android