We’re live!
betterdata
TRACKING GUIDE

Connect journeys across domains

Keep an opted-in visitor’s journey together when they move to a verified store, app or subdomain.

← All documentation

Verify the domains

Use one Betterdata website and the same site ID on every page. Verify the primary domain in Website settings before tracking its subdomains. Add each different root domain under Additional domains and verify its DNS TXT record. An unverified destination cannot receive an identity link.

Install on both pages

Install the Betterdata script with the same data-site value on the source and destination. Use persistent identity on both. If your site requires consent, grant it before linking. The browser cannot share localStorage directly between different origins.

<script defer src="https://YOUR-TRACKER-HOST/track.js" data-site="YOUR_SITE_ID" data-privacy="persistent"></script>

Link before navigation

Call betterdata.link(destination) from the user action that navigates away. Wait for the returned URL, then navigate. If linking fails, your app can still use the original destination; that journey will not be joined. Betterdata currently requires this explicit helper for cross-origin navigation, including subdomains.

async function openCheckout() {
  const destination = "https://shop.example.org/checkout";
  try {
    await window.betterdata.ready;
    location.assign(await window.betterdata.link(destination));
  } catch {
    location.assign(destination);
  }
}

What the link carries

The helper waits for the first successful collector pageview response, then requests a short-lived link token. The token is bound to one verified destination host, expires after two minutes and can be redeemed once. The receiving tracker removes bd_link from the address bar before sending its pageview. Other query parameters remain. Betterdata stores the token hash, not the raw token.

Memory-only sites cannot issue or redeem identity links. Revoked consent and browser opt-out stop linking. A browser on another device or an unlinked navigation starts a separate identity.