Simmer Docs

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>
AttributeRequiredWhat it does
data-projectyesYour project ID from the dashboard.
data-collect-urlyesEndpoint that receives tracked events.
data-identify-urlyesEndpoint 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

EventWhen it fires
page_viewOn initial load and on every SPA navigation.
form_submitWhen a HubSpot embedded form (V3 or V4) submits successfully.
scroll_50 / scroll_100When the user scrolls past 50% / 100% of the page.
bounceWhen the user leaves immediately with no engagement.

Each event also carries:

  • time_on_page_s — seconds on the page
  • scroll_depth — max scroll percentage reached
  • pathname, title, referrer
  • utm_source, utm_medium, utm_campaign — read from the URL on each event
  • session_id — 30-minute inactivity window
  • anonymous_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>

The pixel does nothing until consent is granted. Three ways to grant it:

  1. Auto-detected CMPs — Simmer reads consent state from the major banners and listens for changes:
    • CookieYes
    • OneTrust
    • Cookiebot
    • Finsweet Cookie Consent
  2. Manual — call window.attrib.consent("granted") from your own consent UI.
  3. 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:

  1. Grant consent (via your CMP or the console: window.attrib.consent("granted")).
  2. Reload the page.
  3. You should see a POST to /api/collect with an event of type page_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.

On this page