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
Step 1 — Make your referral link open the app
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-associationfile athttps://yourapp.com/.well-known/apple-app-site-associationand enable the Associated Domains capability (applinks:yourapp.com) in Xcode. - Android — App Links: host an
assetlinks.jsonfile athttps://yourapp.com/.well-known/assetlinks.jsonand add an<intent-filter android:autoVerify="true">in yourAndroidManifest.xmlmatching 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.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
Step 3 — Report the referral to FirstPromoter
When the user signs up (client → your backend → FirstPromoter):- Send either
emailoruid(or both) — whichever you have at signup time. ref_idis the value you captured from thefprparameter in Step 2.
amountis in cents (4900= $49.00), except for zero-decimal currencies (e.g.JPY), which are sent as whole values.event_idmust 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 byemail/uid.
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
fprparameter 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.
- 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 thecom.android.installreferrerlibrary on first open after install — no third-party SDK required. There is no iOS equivalent.
Need help?
- Tracking API reference — full parameter documentation
- Mobile Attribution Providers — solving new-install (deferred) attribution with Branch.io or similar
- Tracking without fpr.js — the same API-only pattern used here, written for websites
- Support — reach the team if you’re still stuck