Repository navigation
feat(attribution): expose install-match certainty on the deferred deep link - #18
Merged
Merged
Conversation
…p link The deferred deep link passed to onDeferredDeepLink now carries confidenceScore, matchedFactors, attributionMethod and competingLinks, and InstallResponse carries attributionMethod and competingLinks. competingLinks counts the other links that had a click from the install's network that also reached the confidence threshold, so an app acting on a sensitive link can treat a contested match as unverified and ask the user to confirm. The fields are read leniently (missing or unexpected values become null, a whole-number double becomes an int), are null on direct opens and on launches after the one that reports the install, and are stored with the install's deep link; install data saved by earlier versions still decodes. Version 0.5.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
DeepLinkDatagains nullableconfidenceScore(double?),matchedFactors(List<String>?),attributionMethod(String?) andcompetingLinks(int?). The install endpoint sends them insidedeepLinkDataon a match, so they reach the app throughonDeferredDeepLink. The resolve endpoint never sends them, so they arenullon a direct open.fromJson/toJson,==,hashCode,toStringandmergingUrlParametersinclude them.InstallResponsegains nullableattributionMethod("fingerprint"or"none") andcompetingLinks, as optional named constructor parameters. The response the SDK builds on later launches (from the stored install data) leaves bothnullrather than inventing values.lib/models/match_certainty_json.dart): a missing or wrongly typed value becomesnull, and a whole-number double (2.0) becomes anint. A bad value in one of these informational fields never drops the deep link or fails the install response.DeepLinkDataJSON, so the fields round-trip throughgetInstallData(); data stored by earlier versions decodes with themnull.competingLinksexplains what it means; README has a "How certain is the match?" section with an example; CHANGELOG entry; version 0.5.0 inpubspec.yaml,SdkInfo.versionandexample/pubspec.lock. Generated*.g.dartfiles rebuilt withbuild_runner.Why
competingLinkstells an app whether other links on the same network were also in contention for the install.0means no other link was; above0, another device's tap 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. The match score and factors were already sent on the deferred deep link but not exposed by the SDK.Tests
"none"for organic, a doublecompetingLinks, wrongly typed values read asnull, JSON round-trip, equality/hashCode,mergingUrlParameterskeeping the fields.nullfor both newInstallResponsefields.flutter test(164 passed),flutter analyze(no issues),dart format --output=none --set-exit-if-changed .(clean),dart run build_runner build --delete-conflicting-outputs(no diff inlib),flutter pub publish --dry-run(0 warnings).