Skip to main content
When you finish, a purchase that arrives from Stripe, Shopify, Whop, RevenueCat, or Superwall resolves to the browser session that clicked the ad.

The four identifiers

Every event carries all four, so they’re not alternatives to choose between. visitor_id stays anonymous after identify(). It never becomes the user_id.
Use visitor_id in server-side and webhook work. Every revenue source keys off it. Use distinct id when you tell someone where to look in Events or Users.

Call identify at a verified moment

Call identify() after signup, after login, and after an account switch. Pass your immutable internal ID, not an email address.
usr_4821 is the identity. email and plan are traits. A trait can change without breaking the identity. Passing a different user_id runs reset() first, so two people on one browser never merge.
Call reset() on logout. Without it, the next person on a shared device inherits the previous account’s identity, and their conversions attribute to the wrong campaign.
Use alias() only when you know two IDs belong to one person. Never join two identities from an IP address, a device fingerprint, or a name.

How a webhook conversion finds the visitor

Each revenue source carries the visitor_id in a different field. Set the field, or the conversion arrives with revenue and no campaign to credit. A fallback identity still records the revenue. Whop Events context can add a campaign without linking the full website journey.

The email bridge

When no visitor_id reaches the webhook, Datalyr resolves the buyer by email address. The bridge needs an email on both ends, so turn on Auto Identify to let the web session carry one, or call identify() with an email trait yourself.

Settings that change identity

Settings → Identity & Attribution holds five toggles. Each one takes about 5 minutes to reach live browsers, and none of them needs a snippet edit. A workspace flagged as a health vertical defaults Auto Identify and cart attributes to off. See Health and wellness redaction.

Verify

  1. Open your site in a private window.
  2. Sign up with a test email address.
  3. Open Users and search for the user_id you passed.
  4. Confirm the profile lists the anonymous pageviews from before the signup.
  5. Complete a test purchase.
  6. Open Conversions and confirm the row carries a campaign, not direct.

When it does not work

Next