Checkout on another domain in GA4: cross-domain, _gl and referrals
Published by the UTM Builder team at Limner.
Without cross-domain measurement, GA4 creates new cookies on each root domain. Someone who leaves your site for a checkout on another domain becomes two users and two sessions, and the checkout session can start with your own site or the payment gateway as its source. The fix is to add both domains under Configure your domains, with the same tag on both ends, and to list the gateways as unwanted referrals.
Why the sale loses its source
Google Analytics Help explains that without this setup, someone who visits www.example.com and www.anotherexample.com on the same device is counted as two users and two sessions. The ad’s UTM stays tied to the first session, on your domain. The purchase happens in the second one, on the checkout, which doesn’t know where the person came from. That’s how a sale ends up with your own domain as the referral, the payment processor as the source, or no campaign at all.
Configure your domains
- In Admin, under Data collection and modification, click Data streams.
- Click Web and choose the stream.
- At the bottom of the stream details, click Configure tag settings.
- Under Settings, click Configure your domains.
- Accept a suggested domain under Recommendations, or click Add condition, choose the match type and enter the domain. Include yours and the checkout’s.
- Save.
The requirements, according to Google: the Google tag must be on every included domain, every page uses the same G- ID from the same web stream, and you need the Editor role or higher. You can add up to 100 conditions.
The _gl parameter and where it gets lost
With the setup active, the tag adds the _gl parameter to links and forms that lead to an included domain. It carries the cookie IDs from one domain to the other.
https://checkout.exemplo.com/pagamento?_gl=1*abcde5*...
Google’s Help lists what drops _gl:
- A redirect at the destination, or a page that doesn’t accept arbitrary query parameters. The site has to keep
_glthrough the redirect. - Navigation triggered by JavaScript instead of the person clicking a link directly. A buy button that opens the checkout through a script is the typical case.
- Scripts that stop the click from propagating, such as
Event.stopPropagation(). - A domain entered in the interface that differs from the destination domain.
To test, open a page with a link to the checkout, click it, and check that the page loads and that the destination address carries _gl.
Unwanted referrals
When someone pays on a payment processor and comes back to your thank-you page, the processor becomes a referral and can take the campaign’s place. The list is under Admin > Data collection and modification > Data streams > Web > your stream > Configure tag settings > Show all > List unwanted referrals.
- For traffic that matches the list, GA4 appends
ignore_referrer=trueand doesn’t show that domain as the source. - Conditions use OR logic, and you can add up to 50 per stream.
- A returning user whose first session came before the exclusion can still show up with the excluded domain.
- GA4 already doesn’t count as a referral any traffic from the same domain or a subdomain of the current page, or traffic that arrives with
_glfrom a configured domain.
When the checkout isn’t yours
Cross-domain measurement needs your tag on the checkout. If the platform doesn’t let you install your G- ID there, cross-domain can’t work. In that case, list the checkout domain and the gateway domain as unwanted referrals, so at least you don’t lose the source when the person comes back to your site, and read sales by campaign in the platform’s own report, using the parameters it stores.
Some platforms accept your GA4. Kiwify, for example, lets you add the Google Analytics pixel and sends begin_checkout and purchase, with value equal to the producer’s commission. In that case, add the checkout domain under Configure your domains and run the _gl test: the platform’s documentation doesn’t say whether it keeps the parameter.