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

  1. In Admin, under Data collection and modification, click Data streams.
  2. Click Web and choose the stream.
  3. At the bottom of the stream details, click Configure tag settings.
  4. Under Settings, click Configure your domains.
  5. Accept a suggested domain under Recommendations, or click Add condition, choose the match type and enter the domain. Include yours and the checkout’s.
  6. 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:

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.

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.

Official sources