Skip to content

feat(analytics-browser): enable event property attribution by default (SDKW-27)#1860

Open
Mercy811 wants to merge 3 commits into
mainfrom
xinyiye/sdkw-27-move-event-property-based-attribution-tracking-out-of
Open

feat(analytics-browser): enable event property attribution by default (SDKW-27)#1860
Mercy811 wants to merge 3 commits into
mainfrom
xinyiye/sdkw-27-move-event-property-based-attribution-tracking-out-of

Conversation

@Mercy811

Copy link
Copy Markdown
Contributor

Summary

Moves the Browser SDK's event property-based attribution tracking out of the experimental tag and enables it by default, per SDKW-27.

Previously this feature was gated behind an experimental trackingMethod: 'eventProperty' opt-in. It is now a stable, default-on capability so campaign params are attached to event properties automatically.

Changes

  • Remove experimental tags from trackingMethod and fallbackAttributionEvent in AttributionOptions (analytics-core).
  • Change the default tracking method from ["userProperty"] to ["userProperty", "eventProperty"] (normalizeTrackingMethod in analytics-browser). Extracted into a DEFAULT_TRACKING_METHODS constant. Both methods run independently and combine.
  • Update JSDoc @defaultValue for trackingMethod.
  • Update tests asserting the old default.

Backward compatibility

Explicit user configuration is still honored. Users who opted into a specific method (e.g. trackingMethod: 'userProperty' or 'eventProperty') keep exactly their configured behavior — the new default only applies when nothing valid is configured. Existing default users keep their user-property attribution and additionally gain event-property attribution.

Testing

  • analytics-browser: 511 tests pass, 100% coverage
  • analytics-core: 815 tests pass, 100% coverage
  • plugin-event-property-attribution-browser: 12 tests pass, 100% coverage
  • Lint clean on changed packages

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

SDKW-27

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 60.74 KB (+0.02% 🔺)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 134.34 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 214.61 KB (+0.01% 🔺)
@amplitude/element-selector (gzipped esm) 2.67 KB (0%)

@Mercy811 Mercy811 force-pushed the xinyiye/sdkw-27-move-event-property-based-attribution-tracking-out-of branch from 7ff2899 to 63936bf Compare June 30, 2026 21:32
Mercy811 and others added 3 commits June 30, 2026 14:47
… (SDKW-27)

Promote event property-based attribution tracking out of the experimental
tag and enable it by default in the browser SDK.

- Remove the @experimental tags from `trackingMethod` and
  `fallbackAttributionEvent` in AttributionOptions.
- Change the default `trackingMethod` to `["userProperty", "eventProperty"]`
  so attribution params are attached to event properties automatically,
  while preserving the existing user-property attribution behavior.
- Explicit user configuration is still honored, so users who opted into a
  specific method keep their behavior (backward compatible).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…_TRACKING_METHODS readonly

Address code review on SDKW-27:
- Add a browser-client integration test asserting both attribution plugins
  load when no trackingMethod is configured (the new default path).
- Mark DEFAULT_TRACKING_METHODS as readonly to prevent mutation of the
  shared default array.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…eb-attribution tests

The web-attribution integration tests cover the user-property (web) attribution
flow. Now that event-property attribution is enabled by default, pin
trackingMethod to 'userProperty' in these tests' defaultTracking config so the
campaign params are not also attached to event properties, keeping the
assertions focused on the user-property behavior under test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Mercy811 Mercy811 force-pushed the xinyiye/sdkw-27-move-event-property-based-attribution-tracking-out-of branch from 63936bf to 082ef49 Compare June 30, 2026 21:47
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