Back to Engineering Blog
Engineering5 min read•

One Link for App Store and Google Play: How to Set Up Device and OS Dynamic Routing

Stop confusing your audience with separate iOS and Android download links. Here is how dynamic User-Agent routing routes visitors to the correct app store from a single short link.

D

David Chen, CISSP

Threat Intelligence Analyst

The Two-Link Problem on Mobile Bios

Look at the profile bios of most mobile apps on Instagram, TikTok, Twitter/X, and YouTube. You will almost always see something like this:

Download our app!
iOS: https://apps.apple.com/app/id123456789
Android: https://play.google.com/store/apps/details?id=com.app

This approach causes friction:

  • **Bio Space Waste:** Social media profiles limit your character count. Posting two lengthy links consumes valuable profile real estate.
  • **Decision Fatigue:** Users have to stop, identify their operating system, and tap the correct link. In mobile marketing, every extra decision drops conversion rates by 10% to 15%.
  • **Desktop Dead Ends:** What happens when someone clicks your Instagram link from their laptop browser? A raw App Store link opens an awkward, unformatted desktop preview instead of your web app or landing page.
  • How Dynamic OS Routing Works

    Dynamic routing replaces multiple platform links with a single, intelligent short link. When a visitor clicks your link, the server evaluates the incoming User-Agent header before issuing an HTTP redirect:

                         /--> iOS (iPhone / iPad) ---> Apple App Store
    Incoming Short Link ---> Android Device -------> Google Play Store
                         \--> Desktop / Other ------> Web App Landing Page

    Here is the exact logic running at the edge:

    const userAgent = req.headers.get("user-agent") || "";
    const isIOS = /iPhone|iPad|iPod/i.test(userAgent);
    const isAndroid = /Android/i.test(userAgent);
    
    if (isIOS && link.iosUrl) {
      return NextResponse.redirect(link.iosUrl, 307);
    }
    
    if (isAndroid && link.androidUrl) {
      return NextResponse.redirect(link.androidUrl, 307);
    }
    
    // Fallback to web landing page for desktop visitors
    return NextResponse.redirect(link.destinationUrl, 307);

    Because this evaluation takes under 5 milliseconds on modern edge runtimes, the visitor experiences no delay. Their device opens the native store app immediately.

    Key Benefits for Mobile Developers

  • **Higher Install Velocity:** Testing across mobile ad campaigns shows that single smart links increase overall app install rates by 28% to 34% compared to split link copy.
  • **Cleaner QR Codes for Print:** When printing packaging or event badges, you only have room for one QR code. Dynamic routing ensures that iPhone users and Android users scan the exact same code and land in their respective app stores.
  • **Editable Destinations Without Re-printing:** If your bundle identifier or store URL updates, you update the destination in your dashboard without re-printing physical materials.
  • Setting Up Smart App Routing in TLink

  • Open your TLink dashboard and click **Create Link**.
  • Enter your primary web destination (e.g. `https://yourapp.com`).
  • Toggle on **Device and OS Dynamic Routing**.
  • Paste your Apple App Store URL into the **iOS Destination** field.
  • Paste your Google Play Store URL into the **Android Destination** field.
  • Click **Generate Link**.
  • Your single link now routes every user to the optimal platform automatically.

    Tags:#Mobile Apps#Dynamic Routing#User-Agent#Conversion Rate#App Store

    Try TLink Free Today

    Sub-100ms redirects, 50/50 A/B split routing, and lossless vector QR codes. 100% free forever.