Repository navigation
feat(attribution): send the Google Play install referrer with the install - #19
Merged
Merged
Conversation
…tall On the launch that reports the install, the SDK reads the Play install referrer (Play Install Referrer API, at most 2 seconds) and sends it as installReferrer. 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. Without a referrer (another store, a sideload, no answer from Play, any error) the request is unchanged and the install is matched by fingerprint. Adds com.android.installreferrer:installreferrer 2.2, which brings its normal-level BIND_GET_INSTALL_REFERRER_SERVICE permission.
…efly unavailable SERVICE_UNAVAILABLE, SERVICE_DISCONNECTED or a dropped connection gets one more attempt after 250 ms, inside the same 2-second limit. Any other answer is final.
Merged
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.
On the launch that reports the install, the SDK reads the Google Play install referrer and sends it as
installReferreronPOST /api/sdk/v1/install. 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",confidenceScore100,competingLinks0) instead of by fingerprint.PlayInstallReferrerSource(new):InstallReferrerClientbehind a 2-second timeout. If Play's service is briefly unavailable or drops the connection, it asks once more within the same 2 seconds. It returns null without Play (another store, a sideload, an emulator without Play services), on any response code other than OK, and on any error. It always ends the connection.AttributionManagerreads it only when the install is being reported. A later launch, which returns the stored attribution, makes no Play call.DeviceFingerprint.installReferrer: Moshi leaves a null out, so the request is byte-for-byte unchanged without a referrer. A server without this field drops the key and matches by fingerprint.com.android.installreferrer:installreferrer:2.2. Its manifest addscom.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE, a normal permission that is granted without a prompt.Tests: 4 unit tests (referrer sent, left out when Play has none, not read once the install is reported, JSON shape), for 205 in total. One instrumented test checks that the real reader finishes within its timeout and doesn't throw on the CI emulators.
No version bump: the release PR takes it. The changelog names
@linkforty/core1.41.1, the first release on npm with core#84.