feat: SDK identity, last-click attribution, and screen-view tracking#2
Merged
Conversation
- Report sdkName/sdkVersion on the install and event payloads and send an X-LinkForty-SDK header on all requests, sourced from BuildConfig. - Stamp every event with the deep link that most recently opened the app (deferred install or direct re-engagement) plus a per-app-open sessionId, via a new persisted AttributionContext. The newest open supersedes; the active link persists across restarts; organic activity stays session-only. - Add trackScreenView() and a LinkFortyNavObserver (a Jetpack Navigation OnDestinationChangedListener; androidx.navigation as compileOnly) that emit screen_view events with screen/previousScreen carrying the attribution stamp. All additive and backward compatible.
Update the README and API reference for trackScreenView / LinkFortyNavObserver and automatic last-click attribution. Add a RELEASING guide.
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.
Summary
Brings the Android SDK up to the React Native / Expo feature line, across three additive capabilities:
sdkName/sdkVersionon the install and event payloads plus anX-LinkForty-SDKheader on all requests (sourced fromBuildConfig, so it always matches the published artifact). Lets the backend report which SDKs and versions are in use.sessionId. The newest open supersedes the previous one, the active link persists across app restarts, and activity with no preceding deep-link open stays organic (session only). The conversion window is applied server-side at query time.LinkForty.shared.trackScreenView(name)plus aLinkFortyNavObserverfor automatic tracking: it's a Jetpack NavigationOnDestinationChangedListenerthat reports each destination's route/label.androidx.navigationis acompileOnlydependency, so apps that don't use Jetpack Navigation are unaffected. Both emitscreen_viewevents (withscreen/previousScreen) carrying the attribution stamp.All changes are additive and backward compatible; no integration changes are required for existing apps.
Implementation notes
AttributionContextholds the active{ linkId, clickId?, openedAt }+ rotatingsessionId, persisted viaStorageManager; updated at both deep-link delivery seams inDeepLinkHandlerand stamped onto each event byEventTracker.EventRequestgains nullableattributedLinkId/attributedClickId/linkOpenedAt/sessionId(Moshi omits nulls, so organic events stay clean).screen_viewevent,screen/previousScreenin event data).Testing
./gradlew :sdk:testDebugUnitTest— BUILD SUCCESSFUL, including newAttributionContextand event-stamping / screen-view coverage. Compiles against thecompileOnlyJetpack Navigation dependency.Docs
README and API reference are updated. A
RELEASING.mddocuments the version bump (VERSION_NAMEingradle.properties, which flows toBuildConfig).