Init Options
Pass these options to theinit command when initializing the pixel.
| Option | Type | Default | Description |
|---|---|---|---|
key | string | (required) | Your Immutable publishable API key from Hub |
consent | 'none' | 'anonymous' | 'full' | 'none' | Initial consent level. See Consent Modes. |
consentMode | 'auto' | undefined | Enable automatic CMP detection (Google Consent Mode v2, IAB TCF v2). Mutually exclusive with consent. Starts at none until CMP signals. |
domain | string | Current hostname | Cookie domain scope. Set to .example.com for cross-subdomain tracking. |
autocapture.forms | boolean | true | Auto-capture HTML form submissions |
autocapture.clicks | boolean | true | Auto-capture outbound link clicks |
Example With All Options
Command Queue API
All commands use thewindow.__imtbl.push() pattern. The command queue buffers calls made before the pixel script finishes loading, then replays them in order.
| Command | Arguments | Description |
|---|---|---|
['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:
consent
Update the consent level after initialization, for example after a user interacts with your cookie banner:
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):
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:Content Security Policy
If your site enforces a Content-Security-Policy header, add these directives: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.
Browser Support
| Browser | Minimum version |
|---|---|
| Chrome | 80+ |
| Firefox | 78+ |
| Safari | 14+ |
| Edge | 80+ |
Event Delivery
- Events are batched and flushed every 5 seconds or when 20 events accumulate, whichever comes first
- The
session_endevent usesnavigator.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