You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/audience/pixel/README.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# @imtbl/pixel — Immutable Tracking Pixel
1
+
# @imtbl/pixel
2
2
3
3
A drop-in JavaScript snippet that captures device signals, page views, and attribution data for Immutable's events pipeline. Use it to measure campaign performance and attribute player acquisition across your marketing sites, landing pages, and web shops. Zero configuration beyond a publishable key.
4
4
@@ -21,7 +21,7 @@ document.head.appendChild(s);
21
21
22
22
Replace `YOUR_PUBLISHABLE_KEY` with your project's publishable key from [Immutable Hub](https://hub.immutable.com/).
23
23
24
-
The script loads asynchronously and does not block page rendering. The default consent level is `none` — the pixel loads but does not collect until consent is explicitly set (see [Consent Modes](#consent-modes)). To start collecting anonymous device signals immediately, add `"consent":"anonymous"` to the init options:
24
+
The script loads asynchronously and does not block page rendering. The default consent level is `none`: the pixel loads but does not collect until consent is explicitly set (see [Consent Modes](#consent-modes)). To start collecting anonymous device signals immediately, add `"consent":"anonymous"` to the init options:
|`none`| Nothing — pixel loads but is inert | None | Before consent banner interaction |
37
+
|`none`| Nothing (pixel loads but is inert)| None | Before consent banner interaction |
38
38
|`anonymous`| Device signals, attribution, page views, form submissions, link clicks (no PII) |`imtbl_anon_id`, `_imtbl_sid`| Anonymous analytics without PII |
39
39
|`full`| Everything in `anonymous` + hashed email capture from form submissions (for identity matching) |`imtbl_anon_id`, `_imtbl_sid`| After explicit user consent for marketing/ads |
40
40
@@ -47,12 +47,12 @@ If your site uses a Consent Management Platform (CMP), the pixel can auto-detect
> **Note:**`consentMode` and `consent` are mutually exclusive — do not set both.
50
+
> **Note:**`consentMode` and `consent` are mutually exclusive. Do not set both.
51
51
52
52
The pixel starts in `none` and checks for these CMP standards (in priority order):
53
53
54
-
1.[**Google Consent Mode v2**](https://developers.google.com/tag-platform/security/guides/consent?consentmode=advanced) — reads `analytics_storage` and `ad_storage` from `window.dataLayer`
55
-
2.[**IAB TCF v2**](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md) — reads purpose consents via `window.__tcfapi`
54
+
1.[**Google Consent Mode v2**](https://developers.google.com/tag-platform/security/guides/consent?consentmode=advanced): reads `analytics_storage` and `ad_storage` from `window.dataLayer`
55
+
2.[**IAB TCF v2**](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md): reads purpose consents via `window.__tcfapi`
56
56
57
57
Once a CMP is detected, the pixel upgrades consent automatically and continues listening for changes (e.g. when a user updates their cookie preferences). If no CMP is detected after ~2.5 seconds, the pixel remains in `none` silently (there is no failure callback). If your CMP may not be present on every page, push a manual fallback on your own timeout:
58
58
@@ -67,7 +67,7 @@ setTimeout(function() {
67
67
If you are not using `consentMode: 'auto'`, you can set consent manually at any time:
68
68
69
69
```javascript
70
-
// After cookie banner interaction — upgrade to full
70
+
// After cookie banner interaction, upgrade to full
71
71
window.__imtbl.push(['consent', 'full']);
72
72
73
73
// Or downgrade (purges PII from queue)
@@ -109,9 +109,8 @@ document.head.appendChild(s);
109
109
## Test mode
110
110
111
111
Set `"testMode": true` in the init options to mark every event with a
112
-
top-level `test: true` flag. Useful for development, staging, or QA —
113
-
events still flow through the production endpoint, but can be filtered
114
-
out of production analytics downstream.
112
+
top-level `test: true` flag. Test events still flow through the
113
+
production endpoint, but can be filtered out of production analytics.
0 commit comments