Skip to main content
Deep Linking for Mobile Apps covers tracking referrals when the user already has your app installed. This guide solves the harder case: the user doesn’t have your app yet. When someone taps an affiliate link without your app installed, iOS and Android route them to the App Store / Play Store. Neither platform passes the original link’s query parameters through that install — by the time the app opens for the first time, the referral ID (fpr=joe13) is gone. This is why “deferred deep linking” tools exist. FirstPromoter doesn’t run its own — instead, you point one of these providers at your app and forward whatever referral ID it recovers into FirstPromoter’s Tracking API, the same way as the direct-install case.
This guide uses Branch.io as the worked example since it’s the most commonly used for this pattern, but AppsFlyer (OneLink) and Adjust solve the same problem the same way — a redirect link with custom data, an SDK that reads that data back on first open, and an attribution callback in your app code. If you’re already using one of those for ad attribution, reuse it here instead of adding Branch.

How it works end to end


For each affiliate, once you have their FirstPromoter referral link (e.g. https://yourapp.com/r?fpr=joe13), create a corresponding Branch link with the ref_id stored as custom data, and the FirstPromoter link set as the desktop/web fallback so anyone opening it on desktop still lands on your normal site:
Share the resulting https://yourapp.app.link/... URL as the affiliate’s mobile referral link (in addition to, or instead of, the plain FirstPromoter one, depending on where you expect it to be shared).
You can automate this: whenever FirstPromoter creates or returns a promoter’s referral link (via the dashboard, or the Promoter API), call the Branch URL API from your backend to mint the matching Branch link, and show that to the affiliate instead.

Step 2 — Initialize the Branch SDK and read the referral ID

Branch returns the same fpr_ref_id custom data key whether the link was opened directly (app already installed) or resolved after a fresh install (deferred) — your app doesn’t need separate logic for the two cases. That’s the problem Branch (or an equivalent provider) is solving for you.

Step 3 — Report the referral ID to FirstPromoter

Once fpr_ref_id is captured, the rest is identical to the direct deep-linking flow — send it to your backend, and have your backend call the FirstPromoter Tracking API:
As with direct deep linking, keep your FirstPromoter API key on your backend only — never call this endpoint directly from the mobile app. See Deep Linking for Mobile Apps → Step 3 for the sales-tracking call and full parameter list.

Using AppsFlyer or Adjust instead

The pattern is the same; only the SDK callback differs: Whichever you use, the goal is the same: get the FirstPromoter ref_id out of the provider’s attribution payload, then make the same two Tracking API calls (/track/signup, /track/sale) from your backend described in Step 3 above and in the Deep Linking guide.

Choosing whether you need this at all

Adding an attribution provider is real integration work and (beyond free tiers) an ongoing cost. Consider whether you need it:
  • If your affiliates mostly share links in contexts where the app is very likely already installed (e.g. existing customers referring other existing users of the same category of app), the direct deep-linking flow in the previous guide may be enough on its own.
  • If a meaningful share of referred signups are brand-new users installing your app for the first time, you need deferred deep linking to avoid losing that attribution — this guide’s approach (or the Android-only Play Install Referrer API from the previous guide) is required.

Need help?