Repository navigation
feat(attribution): expose install match certainty on the deferred deep link - #11
Merged
Merged
Conversation
…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.
|
🎉 This PR is included in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
DeepLinkDatagains optionalconfidenceScore,matchedFactors,attributionMethodandcompetingLinks. They are set on the deferred deep link (onDeferredDeepLink,getInstallData()); direct opens leave them undefined.InstallAttributionResponsegains optional top-levelattributionMethod('fingerprint'when matched to a click,'none'when organic; typed as the exportedAttributionMethod, which accepts future values) andcompetingLinks.deferredDeepLinkFromInstall()insrc/DeferredDeepLink.ts. It keeps the existingdeepLinkParameters->customParametersnormalization and reads each certainty field fromdeepLinkData, 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.competingLinksbefore acting on a sensitive link.Why
The install endpoint reports how certain a fingerprint match is.
competingLinkscounts 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.tscover: the four fields reaching theonDeferredDeepLinkcallback, surviving the JSON round trip used forgetInstallData(),competingLinks: 0being kept, fallback to top-level fields, all four undefined when the server omits them,deepLinkParametersmapping, andnullfor an organic install.