Repository navigation
feat(attribution): report how certain an install match is - #18
Merged
Merged
Conversation
InstallResponse carries attributionMethod ("fingerprint" or "none") and competingLinks, the number of other links that had a click from the install's network that also reached the confidence threshold. Above 0, a tap on another device on the same network may be what led to the install, so an app acting on a sensitive link can treat the match as unverified. Both are null from a server that does not send them, and on launches after the first, which return the stored attribution.
DeepLinkData carries confidenceScore, matchedFactors, attributionMethod and competingLinks on the deferred deep link. They are stored with the install data, so getInstallData() returns them on later launches; data stored by an earlier version decodes with them null, and a direct open leaves them null.
Both constructors are @jvmoverloads with the new parameters last, so the previous Java constructor signatures remain. Version 1.7.0.
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
InstallResponsegainsattributionMethod: String?("fingerprint"when matched to a click,"none"when organic) andcompetingLinks: Int?.DeepLinkDatagainsconfidenceScore: Double?,matchedFactors: List<String>?,attributionMethod: String?andcompetingLinks: Int?. They are set on the deferred deep link and null on a direct open (the resolve endpoint does not send them).DeepLinkDatais stored as install data; the new fields round-trip through storage, and install data stored by an earlier SDK version decodes with them null.initialize()builds itsInstallResponsefrom stored data;attributionMethodandcompetingLinksare left null there rather than guessed. The storedDeepLinkDatakeeps the values from the launch that reported the install.@JvmOverloadswith the new parameters last, so the previous Java constructor signatures (10-argDeepLinkData, 5-argInstallResponse) still exist. Kotlin code compiled against 1.6.x that constructs either class with default arguments, or callscopy(), must be recompiled; Kotlin source compiles unchanged.API.md,llms.txtandREADME.mddocument the fields, with a shortcompetingLinksexample in the deferred deep link section.llms.txtalso listsconfidenceScoreasDouble, which is its type.gradle.properties,README.mdandCHANGELOG.md.Why
competingLinkstells an app whether other links were also in contention for the install. Above 0, a tap on another device on the same network may be what led to this install, so an app acting on a sensitive link (a sign-in, a gift) can treat the match as unverified, for example by asking the user to confirm.confidenceScoreandmatchedFactorswere already sent insidedeepLinkDataand are now exposed to the deferred deep link callback.Tests
InstallResponseand itsdeepLinkData, an organic response withattributionMethod: "none",DeepLinkDatadefaults, a JSON round-trip with the new fields, decoding stored JSON without them, and the cached-launchInstallResponseleaving both fields null../gradlew sdk:testDebugUnitTest sdk:lintDebug(the CI commands): 201 tests, 0 failures; lint clean.javap.