Skip to main content
The Tracking Pixel is currently in alpha. Configuration options may change between releases.

Init Options

Pass these options to the init command when initializing the pixel.
OptionTypeDefaultDescription
keystring(required)Your Immutable publishable API key from Hub
consent'none' | 'anonymous' | 'full''none'Initial consent level. See Consent Modes.
consentMode'auto'undefinedEnable automatic CMP detection (Google Consent Mode v2, IAB TCF v2). Mutually exclusive with consent. Starts at none until CMP signals.
domainstringCurrent hostnameCookie domain scope. Set to .example.com for cross-subdomain tracking.
autocapture.formsbooleantrueAuto-capture HTML form submissions
autocapture.clicksbooleantrueAuto-capture outbound link clicks

Example With All Options

<script>
(function(){
var w=window,i="__imtbl";
w[i]=w[i]||[];
w[i].push(["init",{
  "key":"YOUR_PUBLISHABLE_KEY",
  "consent":"anonymous",
  "domain":".example.com",
  "autocapture":{"forms":true,"clicks":false}
}]);
var s=document.createElement("script");s.async=1;
s.src="https://cdn.immutable.com/pixel/v1/imtbl.js";
document.head.appendChild(s);
})();
</script>

Command Queue API

All commands use the window.__imtbl.push() pattern. The command queue buffers calls made before the pixel script finishes loading, then replays them in order.
CommandArgumentsDescription
['init', options]Init options (see above)Initialize the pixel. Must be called exactly once.
['consent', level]'none' | 'anonymous' | 'full'Update the consent level at runtime. Downgrading to none purges PII from the local event queue.
['page', properties?]Record<string, unknown> (optional)Manually fire a page view with optional custom properties.

init

Must be the first command. Typically called inline in the snippet:
window.__imtbl.push(['init', { key: 'YOUR_KEY', consent: 'anonymous' }]);
Update the consent level after initialization, for example after a user interacts with your cookie banner:
// Upgrade to full consent
window.__imtbl.push(['consent', 'full']);

// Downgrade (stops collection, purges PII from queue)
window.__imtbl.push(['consent', 'none']);

page

The pixel fires a page view automatically on load. Use this command to manually trigger additional page views (for example, on virtual route changes):
window.__imtbl.push(['page', { section: 'pricing' }]);
Full SPA support with automatic route change detection is planned for a future release. For now, use manual page calls or the Web SDK (coming soon) for SPA route tracking.

Auto-Capture Configuration

By default, the pixel automatically captures form submissions and outbound link clicks. You can disable either or both:
// Disable form capture, keep click tracking
window.__imtbl.push(["init",{
  "key":"YOUR_KEY",
  "consent":"anonymous",
  "autocapture":{"forms":false,"clicks":true}
}]);

// Disable all auto-capture (only page views and sessions)
window.__imtbl.push(["init",{
  "key":"YOUR_KEY",
  "consent":"anonymous",
  "autocapture":{"forms":false,"clicks":false}
}]);

Content Security Policy

If your site enforces a Content-Security-Policy header, add these directives:
script-src: https://cdn.immutable.com
connect-src: https://api.immutable.com
For nonce-based CSP policies, add the nonce attribute to the inline <script> tag. The nonce covers the inline snippet only. The CDN-loaded script is authorized by the script-src directive.
<script nonce="YOUR_NONCE">
(function(){
var w=window,i="__imtbl";
w[i]=w[i]||[];
w[i].push(["init",{"key":"YOUR_KEY","consent":"anonymous"}]);
var s=document.createElement("script");s.async=1;
s.src="https://cdn.immutable.com/pixel/v1/imtbl.js";
document.head.appendChild(s);
})();
</script>

Browser Support

BrowserMinimum version
Chrome80+
Firefox78+
Safari14+
Edge80+

Event Delivery

  • Events are batched and flushed every 5 seconds or when 20 events accumulate, whichever comes first
  • The session_end event uses navigator.sendBeacon() to ensure delivery on page unload
  • All events include surface: "pixel" to distinguish them from Web SDK events in the pipeline

Next Steps

Quickstart

Install the pixel on your site

Data Dictionary

Full reference of collected data