A huge amount of valuable attribution context exists only in the browser for a brief moment. Identifiers like gclid (Google Click ID) and fbclid (Facebook Click ID), along with UTM parameters and referrer information, are often lost during complex user journeys, especially those involving cross-domain redirects or server-side conversions. Browser State Capture is our systematic approach to collecting and persisting this ephemeral data, forming a crucial part of our strategy to deliver complete and trustworthy data.

How it Works

The Datahappy Pixel is designed to do more than just track events. As soon as it loads, it intelligently scans the page for critical attribution context and session information.
  1. Context Capture: The Pixel automatically captures key identifiers and parameters from the URL and browser state:
    • Click IDs: gclid, fbclid, msclkid, etc.
    • UTM Parameters: utm_source, utm_medium, utm_campaign, etc.
    • Referrer Information: The document.referrer
    • Initial Page Load Data: The initial landing page URL
  2. Stateful Persistence: This captured context is immediately sent to our stateful server-side API. The server then associates this information with the user’s profile and persists it
  3. Real-Time Enrichment: From that point on, every subsequent event from that user – whether it comes from the client-side Pixel or a server-side webhook – is automatically enriched with this persisted attribution context

Why it Matters

Imagine a user clicks a Google Ad, lands on your website, browses, and then completes a purchase two days later via a link in an email.
  • Without Browser State Capture: The gclid from the initial ad click is long gone by the time the conversion happens. You can’t tell Google Ads which click led to the purchase, so your ROAS is inaccurate
  • With Browser State Capture: The gclid is captured on the first page view and stored with the user’s profile. When the purchase event arrives two days later, we automatically attach the original gclid before sending the conversion to the Google Ads Offline Conversions API
This process ensures that you can accurately attribute conversions to the correct marketing touchpoints, even when they happen days later or on a different domain, giving you a complete and trustworthy view of your marketing performance.