Repository navigation
feat(audience): add trackConversion for pixel/CAPI dedup - #2932
Merged
Merged
Conversation
Add a conversion event id primitive so a browser pixel event and its
server-side Conversions API counterpart can be deduplicated on a shared id.
- Add `Audience.trackConversion()`: classifies the visit's network from the
session-cached first-touch attribution, mints a shared id for dedup-capable
networks (Meta, TikTok, Reddit), stamps it onto the event under the reserved
`_imtbl_conversion_id` / `_imtbl_conversion_network` properties, and returns
`{ eventId, network }` for the caller to pass to the browser pixel.
- Add `Audience.getAttributionNetwork()` instance method (classifies from the
cached snapshot) and keep a standalone `getAttributionNetwork(attribution?)`
that falls back to the live URL for consumers without an SDK instance.
- Remove the `isPaid*` helpers in favour of the single network classifier.
BREAKING CHANGE: `isPaidMeta`/`isPaidTikTok`/`isPaidGoogle`/`isPaidReddit`/
`isPaidX` are removed; use `getAttributionNetwork()` instead.
✅ Pixel Bundle Size — @imtbl/pixel
Budget: 10.00 KB gzipped (warn at 8.00 KB) |
✅ Audience Bundle Size — @imtbl/audience
Budget: 24.00 KB gzipped (warn at 20.00 KB) |
|
View your CI Pipeline Execution ↗ for commit 821bdac
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
…or Nx 23 Nx 23 removed the top-level `release.releaseTagPattern` property (it moved to the nested `release.releaseTag` object), which broke `nx release version` and blocked all SDK publishes. Nest the pattern so releases work again.
JCSanPedro
commented
Jul 29, 2026
| "releaseTagPattern": "{version}", | ||
| "releaseTag": { | ||
| "pattern": "{version}" | ||
| }, |
Contributor
Author
There was a problem hiding this comment.
fixes pre release publish
nattb8
approved these changes
Jul 29, 2026
This branch was previously deployed
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 a conversion event id primitive to
@imtbl/audienceso a browser pixel event and its server-side Conversions API (CAPI) counterpart can be deduplicated on a shared id. Today Game Page fires browser pixels client-side and postbacks fires CAPI events server-side for the samesign_up, with no common id, so ad networks double-count the conversion.This is piece 1 of 3 (SDK-719). Follow-ups: SDK-720 (Play fires vendor pixels with the shared id) and SDK-721 (postbacks reads the shared id + event-name mapping).
Changes
Audience.trackConversion(event, properties?)- behaves liketrack(), and additionally: classifies the visit's network from the session-cached first-touch attribution (the same signals that drive server-side attribution), mints a shared id for dedup-capable networks (Meta, TikTok, Reddit), stamps it onto the event under the reserved_imtbl_conversion_id/_imtbl_conversion_networkproperties, and returns{ eventId, network }. The caller passeseventIdto the browser pixel (e.g. Metafbq('track', 'CompleteRegistration', {}, { eventID })).Audience.getAttributionNetwork()instance method - classifies from the client's cached snapshot so client- and server-side attribution agree even after the landing URL's query params are gone.getAttributionNetwork(attribution?)- retained and made optional-arg: classifies from a passed snapshot, else falls back to the live URL, for consumers that have a pixel but no SDK instance.sdk/src/conversion.ts(_imtbl_conversion_id,_imtbl_conversion_network,DEDUP_CAPABLE_NETWORKS). These are a cross-service contract with the postbacks builders (SDK-721).Breaking change
Removes
isPaidMeta/isPaidTikTok/isPaidGoogle/isPaidReddit/isPaidX. The only consumer is Game Page (Play), which we control and which is updated in SDK-720 to usegetAttributionNetwork().Test plan
packages/audience/coreunit tests pass (attribution classification, snapshot + live-URL paths)packages/audience/sdkunit tests pass (trackConversion id minting, reserved props, consent gating, instancegetAttributionNetwork)sdk.test-d.tscompile-time assertions)