Skip to main content
FirstPromoter’s standard integration (fpr.js + cookies) is built for browsers. A native mobile app has no cookies and no document, so referral tracking has to be done a different way: capture the referral ID from the incoming link, then report it to FirstPromoter yourself via the Tracking API.
This guide covers the case where the user already has your app installed — tapping the affiliate’s link opens the app directly and the referral data survives the trip. If the user does not have the app installed yet, the link has to go through the App Store / Play Store first, and standard deep links lose the referral data in that round-trip. That “deferred deep linking” problem is covered separately in Mobile Attribution Providers — read this guide first, since the concepts (extracting the ref ID, calling the Tracking API) are the same either way.

How it works

The supported query parameters for a referral link are fpr, via, fp_ref, deal, ref, _from, _by, _go. Pick one and use it consistently — fpr is the default used throughout this guide.

For the link to open your app directly (instead of a mobile browser) when the app is already installed, register your domain as:
  • iOS — Universal Links: host an apple-app-site-association file at https://yourapp.com/.well-known/apple-app-site-association and enable the Associated Domains capability (applinks:yourapp.com) in Xcode.
  • Android — App Links: host an assetlinks.json file at https://yourapp.com/.well-known/assetlinks.json and add an <intent-filter android:autoVerify="true"> in your AndroidManifest.xml matching your domain.
A misconfigured apple-app-site-association or assetlinks.json is the most common reason deep links silently fall back to the browser instead of opening the app. Verify both files are served over HTTPS with no redirects and a Content-Type of application/json.
If you don’t want to set up Universal/App Links yet, a custom URL scheme (yourapp://ref?fpr=joe13) works too, but it can’t be used as the affiliate-facing link on its own (it won’t resolve in a browser or sms/social share preview) — pair it with a normal https:// fallback link that redirects to it, or use one of the frameworks below which handle both.

Step 2 — Capture the referral ID on app open

If you use React Navigation, wire this into its own deep linking config getStateFromPath/subscribe instead of a second parallel Linking listener, to avoid handling the same URL twice.

Step 3 — Report the referral to FirstPromoter

Never embed your FirstPromoter API key in the mobile app. The Tracking API requires a Bearer API key that can create signups and sales on your account — anyone who decompiles your app binary would be able to extract it. Send the stored referral ID from the app to your own backend, and make the FirstPromoter API call from there.
When the user signs up (client → your backend → FirstPromoter):
  • Send either email or uid (or both) — whichever you have at signup time.
  • ref_id is the value you captured from the fpr parameter in Step 2.
See the full Leads & Sign-ups API reference for all parameters. When the user makes a purchase (in-app purchase confirmed server-side, subscription webhook, etc.):
  • amount is in cents (4900 = $49.00), except for zero-decimal currencies (e.g. JPY), which are sent as whole values.
  • event_id must be unique per transaction — it’s how FirstPromoter deduplicates retried webhook/receipt calls.
  • If you already reported the signup with a ref_id, you don’t need to pass it again on the sale call — FirstPromoter matches the sale to the lead by email/uid.
See the full Sales Tracking API reference.

Limitations of direct deep linking

This approach only works when the app is already installed. If it isn’t:
  • Tapping the link opens the App Store / Play Store listing (or a fallback web page) instead of the app.
  • The fpr parameter is not carried through the install — the app has no way to read it on first open, because the OS doesn’t pass launch parameters from an unrelated store install.
This is a limitation of iOS/Android themselves, not FirstPromoter — every affiliate/attribution tool runs into it. There is one native, first-party workaround on Android only:
  • Google Play Install Referrer API lets you append a referrer string to the Play Store URL (&referrer=fpr%3Djoe13), which Google stores and your app can read via the com.android.installreferrer library on first open after install — no third-party SDK required. There is no iOS equivalent.
If you need reliable new-install attribution on both iOS and Android, see Mobile Attribution Providers, which covers using a service like Branch.io to bridge that gap and still report into FirstPromoter using the same API calls from Step 3.

Need help?