What You Need
- An Immutable Hub account with a project (get started here)
- A publishable API key from your project settings (API keys guide)
- Access to the
<head>tag of the site where you want to install the pixel
Install the Snippet
Paste this into your site’s<head> tag:
YOUR_PUBLISHABLE_KEY with your project’s publishable key from Hub.
This snippet sets
consent to anonymous, which starts collecting anonymous device signals and page views immediately. If your site requires explicit cookie consent before any tracking, see Consent Modes below.Verify the Integration
Open your site with the snippet installed, then check the browser developer tools:- Network tab: Look for a request to
https://cdn.immutable.com/pixel/v1/imtbl.js(the pixel script loading) - Network tab: Look for POST requests to
https://api.immutable.com(events being sent). Events flush every 5 seconds or when 20 events accumulate. - Console: Type
window.__imtblto inspect the command queue
Consent Modes
Theconsent option controls what the pixel collects. The default is none, meaning the pixel loads but does not collect anything until consent is set.
| Level | What’s collected | Cookies set | When to use |
|---|---|---|---|
none | Nothing. Pixel loads but is inert. | None | Before cookie banner interaction |
anonymous | Device signals, page views, sessions, form submissions (no PII), outbound clicks | imtbl_anon_id, _imtbl_sid | After basic analytics consent |
full | Everything in anonymous + SHA-256 hashed email from form captures | imtbl_anon_id, _imtbl_sid | After explicit marketing consent |
Setting Consent at Init
To start with the pixel inert (recommended if you have a cookie consent banner):Automatic CMP Detection
If your site uses a Consent Management Platform (such as OneTrust or Cookiebot), the pixel can detect consent state automatically:consentMode is set to auto, the pixel starts in none and checks for these standards:
- Google Consent Mode v2: reads
analytics_storageandad_storagefromwindow.dataLayer - IAB TCF v2: reads purpose consents via
window.__tcfapi
Downgrading Consent
You can downgrade consent at any time. Downgrading tonone purges any PII from the local event queue:
What the Pixel Tracks Automatically
Once consent is set toanonymous or higher, the pixel captures these events with no additional code:
| Event | When it fires | What it captures |
|---|---|---|
| Page view | Every page load | UTM parameters, click IDs (gclid, fbclid, ttclid, msclkid, dclid, li_fat_id), referrer, landing page, referral codes |
| Session start | New session begins | Session ID |
| Session end | Page unload | Session ID, duration in seconds |
| Form submission | HTML form submit | Form action, ID, name, field names. At full consent: SHA-256 hashed email. |
| Outbound link click | Click on external link | Destination URL, link text, element ID |
Cross-Subdomain Tracking
To track users across subdomains (e.g.www.example.com and shop.example.com), set the domain option:
Content Security Policy (CSP)
If your site uses a Content-Security-Policy header, you’ll need to allowcdn.immutable.com (script) and api.immutable.com (events). See the Configuration reference for the full directives and nonce-based CSP setup.
FAQ
Will ad blockers affect the pixel?
Will ad blockers affect the pixel?
The pixel uses first-party cookies and standard
fetch() requests, which minimizes interference from ad blockers. First-party domain hosting further reduces this risk.Does the pixel support Single Page Applications?
Does the pixel support Single Page Applications?
The pixel fires a page view on initial load only. For SPA route changes, use the Web SDK’s
page() method (coming soon). SPA support is planned for a future pixel release.What's the bundle size?
What's the bundle size?
Under 10 KB gzipped. The script loads asynchronously and does not block page rendering.
What browsers are supported?
What browsers are supported?
Chrome 80+, Firefox 78+, Safari 14+, Edge 80+.
How does this work with OneTrust or Cookiebot?
How does this work with OneTrust or Cookiebot?
Next Steps
Data Dictionary
What the pixel collects at each consent level
Configuration Reference
All init options and command queue methods
Attribution
Learn how pixel data powers player attribution
API Keys
Manage your publishable and secret keys