feat(audience): sessionId on all events, UTMs on sign_up and link_clicked (SDK-140)#2864
Open
ImmutableJeffrey wants to merge 1 commit intomainfrom
Open
feat(audience): sessionId on all events, UTMs on sign_up and link_clicked (SDK-140)#2864ImmutableJeffrey wants to merge 1 commit intomainfrom
ImmutableJeffrey wants to merge 1 commit intomainfrom
Conversation
|
View your CI Pipeline Execution ↗ for commit 0af222f
☁️ Nx Cloud last updated this comment at |
✅ Pixel Bundle Size — @imtbl/pixel
Budget: 10.00 KB gzipped (warn at 8.00 KB) |
nattb8
reviewed
Apr 16, 2026
| export class Audience { | ||
| private static liveInstances = 0; | ||
|
|
||
| private static readonly UTM_EVENTS: ReadonlySet<string> = new Set([ |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
nattb8
reviewed
Apr 16, 2026
| }, | ||
| moduleNameMapper: { | ||
| '^@imtbl/audience-core$': '<rootDir>/../core/src/index.ts', | ||
| '^@imtbl/(.*)$': '<rootDir>/../../../node_modules/@imtbl/$1/src', |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
nattb8
reviewed
Apr 16, 2026
| private static liveInstances = 0; | ||
|
|
||
| private static readonly UTM_EVENTS: ReadonlySet<string> = new Set([ | ||
| 'sign_up', 'link_clicked', |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
…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>
735058f to
0af222f
Compare
✅ Audience Bundle Size — @imtbl/audience
Budget: 24.00 KB gzipped (warn at 20.00 KB) |
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
Adds
sessionIdto allpage()andtrack()event properties. Adds UTM attribution (parsed fresh from the current URL) tosign_upandlink_clickedtrack events only.Renames
collectAttribution→collectSessionAttributionand introducescollectPageAttribution(no session cache). Extracts shared URL-parsing logic into abuildAttributionhelper. Removes a dead empty-check guard inpage(). Fixes@imtbl/metricsresolution in the SDK jest config.Linear: SDK-140