Skip to content

feat: SDK identity, last-click attribution, and screen-view tracking#2

Merged
onamfc merged 2 commits into
mainfrom
brandon/sit-269-android-sdk-parity
Jun 11, 2026
Merged

feat: SDK identity, last-click attribution, and screen-view tracking#2
onamfc merged 2 commits into
mainfrom
brandon/sit-269-android-sdk-parity

Conversation

@onamfc

@onamfc onamfc commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Brings the Android SDK up to the React Native / Expo feature line, across three additive capabilities:

  • SDK identitysdkName/sdkVersion on the install and event payloads plus an X-LinkForty-SDK header on all requests (sourced from BuildConfig, so it always matches the published artifact). Lets the backend report which SDKs and versions are in use.
  • Last-click attribution — every in-app event is stamped with the deep link that most recently opened the app (deferred install or direct re-engagement) plus a per-app-open 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.
  • Screen-view trackingLinkForty.shared.trackScreenView(name) plus a LinkFortyNavObserver for automatic tracking: it's a Jetpack Navigation OnDestinationChangedListener that reports each destination's route/label. androidx.navigation is a compileOnly dependency, so apps that don't use Jetpack Navigation are unaffected. Both emit screen_view events (with screen/previousScreen) carrying the attribution stamp.

All changes are additive and backward compatible; no integration changes are required for existing apps.

Implementation notes

  • New AttributionContext holds the active { linkId, clickId?, openedAt } + rotating sessionId, persisted via StorageManager; updated at both deep-link delivery seams in DeepLinkHandler and stamped onto each event by EventTracker.
  • EventRequest gains nullable attributedLinkId/attributedClickId/linkOpenedAt/sessionId (Moshi omits nulls, so organic events stay clean).
  • Wire format matches the other SDKs (screen_view event, screen/previousScreen in event data).

Testing

./gradlew :sdk:testDebugUnitTestBUILD SUCCESSFUL, including new AttributionContext and event-stamping / screen-view coverage. Compiles against the compileOnly Jetpack Navigation dependency.

Docs

README and API reference are updated. A RELEASING.md documents the version bump (VERSION_NAME in gradle.properties, which flows to BuildConfig).

onamfc added 2 commits June 11, 2026 08:53
- 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.
@onamfc onamfc merged commit 1c40b27 into main Jun 11, 2026
3 checks passed
@onamfc onamfc deleted the brandon/sit-269-android-sdk-parity branch June 11, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant