Skip to content

feat(attribution): expose install match certainty on the deferred deep link - #11

Merged
onamfc merged 1 commit into
mainfrom
feat/match-certainty
Oct 21, 2026
Merged

onamfc merged 1 commit into
mainfrom
feat/match-certainty

Conversation

@onamfc

@onamfc onamfc commented Oct 21, 2026

Copy link
Copy Markdown
Member

What changed

  • DeepLinkData gains optional confidenceScore, matchedFactors, attributionMethod and competingLinks. They are set on the deferred deep link (onDeferredDeepLink, getInstallData()); direct opens leave them undefined.
  • InstallAttributionResponse gains optional top-level attributionMethod ('fingerprint' when matched to a click, 'none' when organic; typed as the exported AttributionMethod, which accepts future values) and competingLinks.
  • The mapping from the install response to the deferred deep link moves into deferredDeepLinkFromInstall() in src/DeferredDeepLink.ts. It keeps the existing deepLinkParameters -> customParameters normalization and reads each certainty field from deepLinkData, falling back to the top level of the response. A server that sends neither leaves the field undefined; the SDK never fills in a value of its own. The stored install data (getInstallData()) is the same object, so the fields survive later launches.
  • README and llms.txt document the new fields, with a short example of checking competingLinks before acting on a sensitive link.

Why

The install endpoint reports how certain a fingerprint match is. competingLinks counts the other links that had a click from the install's network which also reached the confidence threshold: 0 means no other link was in contention, above 0 means another device's tap may be what led to this install. An app acting on a sensitive link (sign-in, gift) can use it to treat the match as unverified and ask the user to confirm. Servers that do not report these fields keep working as before.

Tests

  • npm run build (gen-version + tsc, as CI runs it): passes.
  • npm test (vitest): 6 files, 74 tests pass. New cases in __tests__/DeferredDeepLink.test.ts cover: the four fields reaching the onDeferredDeepLink callback, surviving the JSON round trip used for getInstallData(), competingLinks: 0 being kept, fallback to top-level fields, all four undefined when the server omits them, deepLinkParameters mapping, and null for an organic install.

…p link

The deferred deep link delivered to onDeferredDeepLink and returned by getInstallData now carries confidenceScore, matchedFactors, attributionMethod and competingLinks. Each is read from the install response's deepLinkData, falling back to the top level of the response, and stays undefined when the server sends neither.

competingLinks counts the other links that had a click from the install's network which also reached the confidence threshold. Above 0, another device's tap may be what led to the install, so an app acting on a sensitive link can ask the user to confirm before trusting the match.

InstallAttributionResponse gains optional attributionMethod and competingLinks, and the AttributionMethod type is exported. The mapping from install response to deferred deep link moves into deferredDeepLinkFromInstall so it is covered by unit tests.
@onamfc
onamfc merged commit b516616 into main Oct 21, 2026
1 check passed
github-actions Bot pushed a commit that referenced this pull request Oct 21, 2026
## 1.8.0 (2026-10-21)

* feat(attribution): expose install match certainty on the deferred deep link (#11) ([b516616](b516616)), closes [#11](#11)
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants