Skip to content

feat(attribution): send the Google Play install referrer with the install - #12

Merged
onamfc merged 1 commit into
mainfrom
feat/play-install-referrer
Oct 22, 2026
Merged

onamfc merged 1 commit into
mainfrom
feat/play-install-referrer

Conversation

@onamfc

@onamfc onamfc commented Oct 22, 2026

Copy link
Copy Markdown
Member

On Android, the install report includes the Google Play install referrer as installReferrer. The redirect puts the link's click id in the referrer of every Play listing it sends an Android visitor to (LinkForty/core#84), so the server matches the install to that exact click (attributionMethod: 'install_referrer', confidenceScore 100, competingLinks 0) instead of by fingerprint.

  • readPlayInstallReferrer() (new, src/InstallReferrer.ts) uses react-native-device-info's getInstallReferrer(), which the SDK already depends on.
    • device-info asks Play when the app starts and returns 'unknown' until Play answers, so the reader checks every 200 ms for up to 2 seconds.
    • It resolves null on iOS, for an empty referrer, at the timeout and on any error. It never rejects.
  • reportInstall reads the referrer in parallel with the fingerprint, so it adds no delay when Play answers quickly. A null referrer is left out of the body.
  • AttributionMethod gains 'install_referrer'. README and llms.txt describe it. A server without this field ignores the key.

Tests: 79 pass, 5 of them new (iOS, value, waiting through 'unknown' and a rejection, empty, timeout). tsc --noEmit is clean.

device-info uses com.android.installreferrer 1.1.2 unless the app sets ext.installReferrerVersion. That version gives the same referrer.

…tall

On Android, the install report includes the Play install referrer as installReferrer, read through react-native-device-info, which asks Play at app start and stores the answer; the SDK waits for it at most 2 seconds, alongside the fingerprint. A LinkForty link puts its click id in the referrer of the Play listing it sends a visitor to, so the server matches the install to that exact click. On iOS, and without a referrer, the request is unchanged and the install is matched by fingerprint.

AttributionMethod gains 'install_referrer'.
@onamfc
onamfc merged commit d471e53 into main Oct 22, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request Oct 22, 2026
## 1.9.0 (2026-10-22)

* feat(attribution): send the Google Play install referrer with the install (#12) ([d471e53](d471e53)), closes [#12](#12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants