Skip to content

feat(audience): sessionId on all events, UTMs on sign_up and link_clicked (SDK-140)#2864

Open
ImmutableJeffrey wants to merge 1 commit intomainfrom
feat/audience-utm-per-page
Open

feat(audience): sessionId on all events, UTMs on sign_up and link_clicked (SDK-140)#2864
ImmutableJeffrey wants to merge 1 commit intomainfrom
feat/audience-utm-per-page

Conversation

@ImmutableJeffrey
Copy link
Copy Markdown
Contributor

@ImmutableJeffrey ImmutableJeffrey commented Apr 16, 2026

Summary

Adds sessionId to all page() and track() event properties. Adds UTM attribution (parsed fresh from the current URL) to sign_up and link_clicked track events only.

Renames collectAttributioncollectSessionAttribution and introduces collectPageAttribution (no session cache). Extracts shared URL-parsing logic into a buildAttribution helper. Removes a dead empty-check guard in page(). Fixes @imtbl/metrics resolution in the SDK jest config.

Linear: SDK-140

@ImmutableJeffrey ImmutableJeffrey requested a review from a team as a code owner April 16, 2026 06:33
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 16, 2026

View your CI Pipeline Execution ↗ for commit 0af222f

Command Status Duration Result
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 2s View ↗
nx affected -t build,lint,test ✅ Succeeded 14s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-16 07:43:54 UTC

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 16, 2026

✅ Pixel Bundle Size — @imtbl/pixel

Metric Size Delta vs main
Gzipped 5795 bytes (5.65 KB) +13 bytes
Raw (minified) 15558 bytes +35 bytes

Budget: 10.00 KB gzipped (warn at 8.00 KB)

Comment thread packages/audience/sdk/src/sdk.ts Outdated
export class Audience {
private static liveInstances = 0;

private static readonly UTM_EVENTS: ReadonlySet<string> = new Set([

This comment was marked as resolved.

},
moduleNameMapper: {
'^@imtbl/audience-core$': '<rootDir>/../core/src/index.ts',
'^@imtbl/(.*)$': '<rootDir>/../../../node_modules/@imtbl/$1/src',

This comment was marked as resolved.

Comment thread packages/audience/sdk/src/sdk.ts Outdated
private static liveInstances = 0;

private static readonly UTM_EVENTS: ReadonlySet<string> = new Set([
'sign_up', 'link_clicked',

This comment was marked as resolved.

…cked (SDK-140)

- Add collectPageAttribution to core (parses current URL, no sessionStorage cache)
- Extract shared buildAttribution helper to deduplicate collection logic
- Rename collectAttribution → collectSessionAttribution, collectFreshAttribution → collectPageAttribution
- page(): include sessionId in properties, remove dead empty-check guard
- track(): include sessionId in properties
- track(): merge fresh UTM attribution for sign_up and link_clicked only
- Fix @imtbl/metrics resolution in SDK jest config

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ImmutableJeffrey ImmutableJeffrey force-pushed the feat/audience-utm-per-page branch from 735058f to 0af222f Compare April 16, 2026 07:41
@github-actions
Copy link
Copy Markdown

✅ Audience Bundle Size — @imtbl/audience

Metric Size Delta vs main (385cac4)
Gzipped 18289 bytes (17.86 KB) +41 bytes
Raw (minified) 53203 bytes +149 bytes

Budget: 24.00 KB gzipped (warn at 20.00 KB)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants