Problem

Why HubSpot loses visitors when they move between your domains

Cookies belong to one domain, so a visitor who moves from your marketing site to your app, booking tool or checkout looks like a new, anonymous visitor on the second domain. HubSpot and GA4 both bridge the gap by adding parameters to links between domains (__hstc, __hssc and __hsfp for HubSpot, _gl for GA4), but only when both domains are configured and the parameters survive the click. Subdomains of the same root domain share cookies and do not need this.

By Vladimir Cvetkoski · Last updated

Root causes

The 6 most common causes, and how to check each one

  1. 01

    The second domain is not set up in HubSpot

    HubSpot only links visitors across domains when the tracking code from the same account is on both, the other domain is added as an additional site domain, and automatic cross-domain linking is on. Then it appends __hstc, __hssc and __hsfp to links between them. Miss any one of these and the visitor starts over on the second domain.

    How to check
    1. 01Open Settings > Tracking & Analytics > Tracking code > Advanced tracking and confirm every domain is listed and cross-domain linking is on.
    2. 02On the second domain, check DevTools > Network for js.hs-scripts.com/<hub id>.js (or js-eu1.hs-scripts.com) with the same Hub ID as the main site.
    3. 03Click a link from the main site to the second domain and check the arrival URL contains __hstc=.
  2. 02

    GA4 cross-domain measurement is not configured

    GA4 needs the same tag ID on every domain and the domains listed in the tag settings. It then adds a _gl parameter to links and form posts between them. Without it, each domain creates its own client ID and the second domain shows your first domain as a referral.

    How to check
    1. 01In GA4, open Admin > Data streams > your web stream > Configure tag settings > Configure your domains and confirm every domain is listed.
    2. 02Click a cross-domain link and check the arrival URL contains _gl=.
    3. 03In Reports > Acquisition > Traffic acquisition, set the dimension to Session source and look for your own domains. They should not be there.
  3. 03

    Redirects, routing or JavaScript navigation strip the parameters

    The linker parameters only help if they reach the destination page. Login redirects, single sign-on, app routers that clean the URL, link shorteners and email link tracking can all drop them. Buttons that navigate with JavaScript instead of a normal link are often not decorated at all, because link decoration listens for clicks on real links.

    How to check
    1. 01In DevTools > Network, tick Preserve log, click the cross-domain link and read each hop. The parameters must still be on the final URL.
    2. 02Inspect the button or link. If it has no real href and navigates in JavaScript, it will not be decorated.
    3. 03Ask whoever owns the app whether it strips unknown query parameters on load.
  4. 04

    The conversion happens in an app with no tracking code

    If sign-up or trial creation happens on an app domain without the HubSpot tracking code, the contact is usually created by an integration or API call with no link to the earlier visits. HubSpot then sets its source to Offline Sources, and the paid click that started the journey disappears from your reports.

    How to check
    1. 01In HubSpot, filter recent contacts by Original Source = Offline Sources and add the Record source and Record source detail 1 columns to see which integration or API created them.
    2. 02Sign up through the app from a tagged URL with a new email address and check the resulting contact's source.
  5. 05

    Booking tools run on someone else's domain

    Calendly, Chili Piper and similar tools load their scheduler from their own domain, usually inside an iframe. Your HubSpot and GA4 cookies are not available there, and cross-domain linking does not work inside an embedded iframe. Whether the meeting keeps its source depends on how the tool creates the contact: through a HubSpot form you control, or through its own integration, which may not pass your UTMs or the HubSpot cookie.

    How to check
    1. 01Book a test meeting from a tagged URL with a new email address and check the contact's Original Source and drill-downs.
    2. 02Find out whether the booking tool or a HubSpot form creates the contact. If the tool does, check whether it passes UTMs into HubSpot properties.
  6. 06

    Checkout and payment domains you do not control

    Hosted checkouts and payment pages cannot run your tracking. When the buyer comes back to your thank-you page, GA4 starts a new session credited to the payment provider unless it is listed as an unwanted referral. In HubSpot, the return can show up as a new referral visit on the contact.

    How to check
    1. 01In GA4 Traffic acquisition, search Session source for your payment provider's domain.
    2. 02Add it under Admin > Data streams > your web stream > Configure tag settings > List unwanted referrals.
    3. 03In HubSpot, check Latest Source on recent paying customers. If it is your payment provider, the return trip is being counted as a visit.
Self-check

Checklist

  1. 01Map every domain and subdomain a buyer can pass through, and mark which ones you control.
  2. 02Confirm the HubSpot tracking code with the same Hub ID loads on every domain you control.
  3. 03Add each separate domain in HubSpot's Advanced tracking settings and turn on cross-domain linking.
  4. 04Add the same domains in GA4 Configure your domains, and add payment providers to unwanted referrals.
  5. 05Click every cross-domain link and confirm __hstc and _gl are still on the URL after all redirects.
  6. 06Compare the hubspotutk cookie and the _ga cookie on both domains. The visitor ID part should be the same.
  7. 07Run a full test conversion on each second domain from a tagged URL with a new email address and check the contact's Original Source.
  8. 08Repeat the tests after every app release or booking tool change, because these setups break quietly.
When it is not a quick fix

When to get help

Cross-domain fixes often touch code you do not own: app routing, login flows, booking tool integrations. As part of The Fix, I trace each hop, change what is needed in your own GTM, HubSpot and GA4 accounts, and write down exactly what changed so your developers can keep it working.

Questions

Common questions

No. HubSpot tracks visitors across subdomains of the same root domain automatically, for example www.example.com to app.example.com. GA4 also sets its cookie on the root domain by default. You need cross-domain setup only for genuinely different domains, such as example.com and exampleapp.io.

That is a self-referral. It means a visitor moved from one of your domains to another and GA4 could not connect the two sessions, usually because the domain is missing from Configure your domains or the _gl parameter was stripped on the way.

No. Link decoration works when a visitor follows a link from one page to another. An iframe from another domain, such as a booking widget or embedded checkout, is a separate document. You need the tool's own integration, events it sends to the parent page, or values passed into it when it loads.