Install the Pixel
Add the Simmer pixel to your site, what it tracks by default, and how to drive it manually.
The pixel is a single <script> tag. It captures page views, form submissions, scroll depth, and time on page, and it forwards each event to Simmer for attribution. Tracking is consent-gated — nothing is sent until consent is granted.
Snippet
Add to the <head> of every page:
<script
src="https://app.letsimmer.com/pixel.js"
data-project="YOUR_PROJECT_ID"
data-collect-url="https://app.letsimmer.com/api/collect"
data-identify-url="https://app.letsimmer.com/api/identify"
defer
></script>| Attribute | Required | What it does |
|---|---|---|
data-project | yes | Your project ID from the dashboard. |
data-collect-url | yes | Endpoint that receives tracked events. |
data-identify-url | yes | Endpoint that hashes emails server-side. |
For SPAs (Next.js, React Router, etc.), put the snippet in your root layout once. The pixel patches history.pushState and history.replaceState to detect client-side navigation — no per-route setup needed.
What gets tracked automatically
| Event | When it fires |
|---|---|
page_view | On initial load and on every SPA navigation. |
form_submit | When a HubSpot embedded form (V3 or V4) submits successfully. |
scroll_50 / scroll_100 | When the user scrolls past 50% / 100% of the page. |
bounce | When the user leaves immediately with no engagement. |
Each event also carries:
time_on_page_s— seconds on the pagescroll_depth— max scroll percentage reachedpathname,title,referrerutm_source,utm_medium,utm_campaign— read from the URL on each eventsession_id— 30-minute inactivity windowanonymous_id— persistent 1-year browser identifier (cookie name:simmer_id)
Manual API
The pixel exposes a small global at window.attrib:
// Track a custom event
window.attrib.track("demo_requested", { plan: "enterprise" });
// Identify a known user (email is hashed server-side, never stored in plaintext)
window.attrib.identify("user@example.com");
// Grant or revoke consent
window.attrib.consent("granted");
window.attrib.consent("denied");Calls made before the script finishes loading are queued and replayed once it's ready, as long as you install the standard stub:
<script>
window.attrib = window.attrib || {
consent: function () { (window.attrib.q = window.attrib.q || []).push(["consent", ...arguments]); }
};
</script>Consent
The pixel does nothing until consent is granted. Three ways to grant it:
- Auto-detected CMPs — Simmer reads consent state from the major banners and listens for changes:
- CookieYes
- OneTrust
- Cookiebot
- Finsweet Cookie Consent
- Manual — call
window.attrib.consent("granted")from your own consent UI. - Strict default — without a CMP and without a manual call, the pixel stays idle.
When consent is revoked, the simmer_id cookie is deleted and event sending stops. Re-granting restores tracking with a fresh anonymous ID.
Verifying installation
Open your site in a browser and check the network tab:
- Grant consent (via your CMP or the console:
window.attrib.consent("granted")). - Reload the page.
- You should see a POST to
/api/collectwith an event of typepage_view.
If nothing fires, the most common causes are: consent not granted, data-project missing or wrong, or a Content Security Policy blocking the script. Ad blockers can also block requests to /api/collect — disable them on your test site or use a 1st-party proxy.