Understanding the full customer journey requires connecting every touchpoint to a single user identity. Datahappy’s stateful, server-first architecture is designed to do this automatically, creating a canonical user profile that serves as the foundation for accurate attribution.

The Canonical User Profile

Every user who visits your site is assigned a unique anonymous ID, managed by our Pixel. As that user interacts with your brand, we collect more identifiers – like a userId after they log in, or an email from a form submission. Our stateful server API acts as the central brain for identity resolution. It automatically:
  1. Merges Identities: When a known identifier (like a userId) is associated with an anonymous visitor, we merge their profiles, linking their pre-login and post-login activity into a single, chronological journey
  2. Persists Traits: User traits (like name, email, or plan) are stored on the server-side profile, enriching every subsequent event from that user
  3. Persists Attribution: Crucially, the attribution context captured via Browser State Capture is stored as part of this canonical profile

First and Last Touch Attribution

As part of the profile enrichment process, our server automatically maintains first_touch and last_touch attribution data for every user.
  • First Touch: The context (UTMs, referrer, landing page) from the user’s very first visit. This is captured once and then permanently associated with the user’s profile
  • Last Touch: The context from the user’s most recent session. This is updated with each new session
Every single event that passes through the Datahappy server is enriched with this first and last touch data in real-time. This means that when a purchase_completed event arrives from a server-side webhook, it is automatically stamped with the UTM parameters from the ad click that first brought that user to your site two weeks ago. This zero-configuration enrichment provides a powerful, out-of-the-box attribution model that ensures every event has the complete context needed for analysis in your downstream tools.