The Ultimate Branch Links Cheat Sheet: Deep Linking & Attribution for Mobile Apps

Introduction

Branch links are a powerful deep linking and attribution solution that enables marketers and developers to create seamless cross-platform experiences for mobile apps. These intelligent links work across devices, platforms, and channels to drive app installs, re-engagements, and conversions while providing robust attribution data. Branch links solve the fragmentation challenges in the mobile ecosystem by routing users to the right destination regardless of their device, operating system, or app installation status.

Core Concepts & Components

ComponentDescription
Deep LinkA URL that takes users to specific in-app content rather than just opening the app
Universal LinkApple’s implementation that opens apps directly from links without redirects (iOS)
App LinkAndroid’s implementation of direct app opening from links (Android)
Web-to-AppTechnology to transition users from mobile web to in-app experiences
Deferred Deep LinkingLinks that store destination information through app install process
Link DomainYour Branch-provided or custom domain used for all Branch links
AttributionTracking which marketing channels drive app installs and engagement
Link DataCustom parameters attached to links for personalization and tracking
Link Control ParametersSpecial parameters that modify link behavior ($desktop_url, $ios_url, etc.)

Link Types Comparison

Link TypeBest ForFeaturesSetup Complexity
Quick LinksMarketing campaigns, sharingEasy creation, customizable, trackingLow
Web SDK LinksWeb-to-app journeysDynamic creation on website, personalizedMedium
App Links (SDK)In-app sharing, referralsCreated within app, user-specificMedium
Journey BannersMobile web conversionsSmart banners with personalizationMedium
Email LinksEmail campaignsOpen tracking, deep linkingMedium
Ad LinksPaid campaignsAttribution, install trackingMedium-High
QR CodesOffline-to-onlineCustomizable, trackableLow
SMS LinksText campaignsShort links, attributionLow
Social Media LinksSocial sharingPlatform-optimized, trackingLow

Step-by-Step Implementation Process

  1. Account & SDK Setup

    • Create Branch account at dashboard.branch.io
    • Configure app settings (store URLs, URI schemes)
    • Integrate Branch SDK in your applications
    • Set up custom link domain (recommended)
  2. iOS Configuration

    • Configure Universal Links capabilities in Xcode
    • Upload AASA file to your web domain
    • Add entitlements and handle deep links in AppDelegate
    • Test Universal Links functionality
  3. Android Configuration

    • Configure App Links in manifest
    • Add Digital Asset Links JSON to website
    • Handle incoming intents in Activity
    • Test App Links functionality
  4. Deep Linking Integration

    • Define deep link routing structure
    • Implement content routing in app
    • Set up default link behavior
    • Create test links for key user journeys
  5. Attribution & Analytics Setup

    • Configure attribution windows
    • Set up conversion events
    • Enable partner integrations
    • Create dashboards for key metrics
  6. Testing & Validation

    • Test links across platforms and states
    • Verify attribution tracking
    • Validate conversion events
    • Check data reporting accuracy

Link Creation Methods

Dashboard Creation

1. Navigate to Marketing > Quick Links in Branch Dashboard
2. Select link type and enter link name
3. Add deep link data (key-value pairs)
4. Configure redirection settings
5. Set analytics tags
6. Generate and copy link

Web SDK Integration

// Initialize Branch
branch.init('key_live_xxxx');

// Create deep link
branch.link({
  tags: ['tag1', 'tag2'],
  channel: 'facebook',
  feature: 'sharing',
  data: {
    '$desktop_url': 'https://yourwebsite.com/fallback',
    'custom_data': 'value',
    'product_id': '1234'
  }
}, function(err, link) {
  // Use generated link
  console.log(link);
});

iOS SDK Link Creation (Swift)

// Set up deep link properties
let linkProperties = BranchLinkProperties()
linkProperties.channel = "in-app"
linkProperties.feature = "sharing"
linkProperties.addControlParam("$desktop_url", withValue: "https://yourwebsite.com/fallback")

// Set up link content
let universalObject = BranchUniversalObject()
universalObject.title = "Product Name"
universalObject.contentDescription = "Product description"
universalObject.imageUrl = "https://yourwebsite.com/img/product.jpg"
universalObject.contentMetadata.customMetadata["product_id"] = "1234"

// Create link
universalObject.getShortUrl(with: linkProperties) { (url, error) in
    if let url = url {
        // Use generated link
        print(url)
    }
}

Android SDK Link Creation (Kotlin)

// Set up link content
val universalObject = BranchUniversalObject()
    .setTitle("Product Name")
    .setContentDescription("Product description")
    .setContentImageUrl("https://yourwebsite.com/img/product.jpg")
    .setContentMetadata(ContentMetadata().addCustomMetadata("product_id", "1234"))

// Set up link properties
val linkProperties = LinkProperties()
    .setChannel("in-app")
    .setFeature("sharing")
    .addControlParameter("\$desktop_url", "https://yourwebsite.com/fallback")

// Create link
universalObject.generateShortUrl(this, linkProperties, Branch.BranchLinkCreateListener { url, error ->
    if (error == null) {
        // Use generated link
        Log.i("BRANCH", "Got link: $url")
    }
})

Common Link Parameters

Standard Parameters

ParameterDescriptionExample Value
$desktop_urlFallback URL for desktophttps://website.com/product
$ios_urlFallback for iOS without apphttps://itunes.apple.com/app/id123
$android_urlFallback for Android without apphttps://play.google.com/store/apps/details?id=com.app
$fallback_urlDefault fallback for all platformshttps://website.com/download
$canonical_urlSEO parameter for web contenthttps://website.com/product/1234
$og_titleOpen Graph title for social sharingAmazing Product
$og_descriptionOpen Graph descriptionCheck out this awesome product
$og_image_urlOpen Graph image URLhttps://website.com/img/product.jpg

Routing Parameters

ParameterDescriptionExample Value
$deeplink_pathIn-app path to route toproduct/1234
$android_deeplink_pathAndroid-specific pathproduct/1234
$ios_deeplink_pathiOS-specific pathproduct/1234
$match_durationHow long to match clicks to opens (seconds)7200
$always_deeplinkForce deeplink open attempttrue
$web_onlyNever try to open the apptrue

Analytics Parameters

ParameterDescriptionExample Value
~channelDistribution channelfacebook, email, sms
~featureLink featuresharing, referral, campaign
~campaignMarketing campaignsummer_sale
~tagsArray of tags[“tag1”, “tag2”]
~stageCustomer journey stagenew_user
~keywordsKeywords for searchproduct, sale

Deep Link Routing in Apps

iOS Handling (Swift)

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
    return Branch.getInstance().application(app, open: url, options: options)
}

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestorableObject]?) -> Void) -> Bool {
    return Branch.getInstance().continue(userActivity)
}

// In AppDelegate didFinishLaunchingWithOptions:
Branch.getInstance().initSession(launchOptions: launchOptions) { (params, error) in
    if let params = params as? [String: AnyObject] {
        // Handle deep link data
        if let productId = params["product_id"] as? String {
            // Navigate to product detail
            self.navigateToProduct(productId: productId)
        }
    }
}

Android Handling (Kotlin)

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    
    // Initialize Branch
    Branch.getAutoInstance(this)
    
    // Handle deep link data
    Branch.sessionBuilder(this).withCallback { branchUniversalObject, linkProperties, error ->
        if (error == null) {
            // Process deep link data
            val productId = branchUniversalObject.contentMetadata.customMetadata["product_id"] as? String
            if (productId != null) {
                // Navigate to product detail
                navigateToProduct(productId)
            }
        }
    }.withData(this.intent.data).init()
}

override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)
    this.intent = intent
    
    // Handle deep link from new intent
    Branch.sessionBuilder(this).withCallback { branchUniversalObject, linkProperties, error ->
        if (error == null) {
            // Process deep link data
            val productId = branchUniversalObject.contentMetadata.customMetadata["product_id"] as? String
            if (productId != null) {
                // Navigate to product detail
                navigateToProduct(productId)
            }
        }
    }.withData(intent.data).init()
}

Testing & Troubleshooting

Common Issues & Solutions

IssuePossible CauseSolution
Universal Links not working on iOSIncorrect AASA fileVerify AASA file is accessible at yourdomair/.well-known/apple-app-site-association
App Links not working on AndroidDigital Asset Links issueCheck assetlinks.json is properly configured and accessible
Deferred deep linking failsSDK integration issueVerify Branch SDK initialization in app
Attribution data missingIncorrect campaign parametersCheck channel, feature, campaign parameters are set correctly
Web fallback not workingMissing fallback URLsEnsure $desktop_url or $fallback_url parameters are set
Link takes users to app store when app is installedPlatform detection issueCheck Universal/App Links configuration and test on latest OS versions
Data not passing to appDeep link handling code issueDebug data receiving in initSession callback
QR code links not workingQR code scanned by native cameraUse Branch QR codes and ensure proper app-opening metadata

Testing Tools

  • Branch Testing Console: Verify link routing behavior
  • Branch Link Debugger: Examine link properties and behavior
  • iOS Universal Link Validator: Test Universal Links setup
  • Android App Links Verification: Check App Links configuration
  • Charles Proxy: Monitor network requests for link resolution
  • Developer Mode in Branch Dashboard: Detailed event logging

Attribution & Analytics Features

Key Metrics & Reports

  • Install Attribution: Track which sources drive installs
  • Re-Engagement: Measure returning user activity
  • Conversion Funnel: Track user progression through key events
  • Campaign Performance: Measure ROI across channels
  • Cohort Analysis: Analyze user behavior over time
  • Revenue Analytics: Track purchase events and value
  • Influencer Marketing: Track referral effectiveness
  • Cross-Platform Performance: Compare iOS vs Android metrics

Analytics Integrations

  • Ad Platforms: Facebook, Google, TikTok, Snapchat, etc.
  • Attribution Partners: AppsFlyer, Adjust, Kochava
  • Marketing Platforms: HubSpot, Marketo, Braze
  • Analytics Tools: Amplitude, Mixpanel, Firebase
  • Data Warehouses: BigQuery, Snowflake, Redshift

Advanced Features & Use Cases

Web-to-App Journeys

  • Smart Banners: Customizable top/bottom banners on mobile web
  • Journeys: Fully customizable interstitials and banners
  • Deepviews: Web preview of in-app content before install
  • Text-Me-The-App: SMS app download links with deep linking

Email Campaigns

  • Click Tracking: Track email opens and link clicks
  • Personalized Deep Links: Create unique links per user
  • A/B Testing: Compare performance of different deeplink strategies
  • Email Service Provider Integrations: Work with major ESPs

Referral Programs

  • User-Generated Links: Allow users to create referral links
  • Reward Tracking: Attribute referrals to specific users
  • Multi-Tier Programs: Track referral chains
  • Fraud Prevention: Detect suspicious referral patterns

QR Codes

  • Custom Design: Create branded QR codes
  • Dynamic Linking: Update destination without changing QR code
  • Offline Attribution: Track conversions from physical materials
  • Contextual Experiences: Deliver location-specific content

Best Practices for Implementation

  • Use Custom Domains: Implement a branded domain for all Branch links
  • Consistent Parameter Naming: Establish conventions for custom data parameters
  • Create Link Templates: Standardize link structures for different channels
  • Test Across Platforms: Verify behavior on iOS, Android, web, and different OS versions
  • Implement Event Tracking: Track key user actions beyond installs
  • Use Journey Analytics: Understand user paths through your marketing funnel
  • Leverage A/B Testing: Test different deep linking strategies
  • Monitor Dashboard: Regularly review performance metrics
  • Keep SDK Updated: Maintain latest SDK version for best performance
  • Document Implementation: Create internal documentation for link structure and usage

Resources for Further Learning

Official Documentation

Support Channels

Learning Resources

Remember that mobile deep linking technology is constantly evolving. Stay updated with Branch’s latest recommendations, especially regarding iOS and Android platform changes that may affect deep linking behavior.

Scroll to Top