Cross-domain tracking between two different root domains
Cookies stop at the registrable domain. A visitor who reads about a product on yoursite.com and buys it on yourshop.com gets a fresh set of cookies on arrival, and GA4 sees two visitors: one who left, one who came from a referral called yoursite.com and bought. Cross-domain tracking stitches the two back together. Subdomains do not need any of this; for shop.yoursite.com read one domain, many subdomains.
How the link works
When the visitor clicks a link to the other domain, the Google tag appends a _gl parameter to the URL. It carries the client ID and the session identifiers, signed and short-lived. The Google tag on the receiving domain reads it, writes the same client ID into its own cookies and continues the session. Everything after that is normal: the second domain's hits carry the first domain's identity, GA4 counts one user, and the purchase keeps the source that brought the visitor to the first site.
Step 1 · Tell the Google tag about both domains
In the web container, open the Google tag → Configuration settings → Cross-domain measurement and list every domain that should be linked, on both containers if the two sites use different ones. Or set it once in GA4: Admin → Data streams → your stream → Configure tag settings → Configure your domains. Each domain must appear on both sides: the sending side decorates links, the receiving side accepts the parameter only from domains it knows.
Step 2 · The Conversion Linker
Google Ads click IDs need the same treatment, otherwise the gclid stays on the first domain and the conversion on the second has nothing to match. In the web container's Conversion Linker tag, turn on Enable linking across domains and list the domains. The Measurebase import creates the Conversion Linker with URL passthrough on; add the domains there.
Step 3 · Measurebase domains
Each root domain gets its own Measurebase domain with its own tagging subdomain, because the tagging subdomain must be on the domain it serves (mbase.yoursite.com and mbase.yourshop.com). Both can point at the same GTM server container: paste the same config string or pick the same container when connecting. Two domains of one account on the same container share a runtime in our infrastructure, so one published container serves both sites and both count toward your plan's domain limit. Server-set cookies such as FPID are set per domain; the _gl parameter carries the browser's client ID across, so after the first hit both sides agree.
Step 4 · Keep the referral out
Even with the link in place, add each domain to the other's unwanted referrals list in the GA4 data stream, so a visitor who arrives without the parameter (an old link, a bookmark, a share) is not counted as referred by your own site. Payment providers and external checkouts belong on that list too; they are not cross-domain candidates, because you do not control their tag.
Test it
- Open the first site, click a link to the second. The landing URL must contain
_gl=. If it does not, the domain is missing from the sending container's list or the link is built by a script that bypasses the tag's click handling. - In GA4 DebugView, the hits from both domains show the same client ID and session.
- In Measurebase, both domains' request logs show the hits arriving on their own tagging subdomains, one session apart.
What the audit checks
The tracking audit recognises sibling domains in your account that measure into the same GA4 property. For those it reads the linker domain list in the Google tag, looks for referral traffic between the siblings in GA4, and during the site crawl it presses links to the other domain and checks whether _gl is appended. A missing domain, a self-referral or an undecorated link becomes a finding on both domains.
Limits worth knowing
- Consent does not travel. The visitor's choice on the first site is not known on the second; most consent tools offer a cross-domain consent feature for that.
- Links only. The parameter rides on clicks the tag can see. Forms that post to the other domain, redirects from a server and links opened by JavaScript may need the
_glvalue added by hand; Google'slinkerAPI exposes it. - Safari. A landing page that arrives with link decoration from a domain Safari classifies as a tracker gets its JavaScript cookies capped at 24 hours. Your own second domain is rarely classified, and server-set cookies through Same-Origin Tracking are not affected.
Frequently asked questions
Can both sites share one tagging subdomain?
No. A tagging subdomain is first-party only for its own registrable domain; serving yourshop.com from mbase.yoursite.com would make its cookies third-party again. One Measurebase domain per root domain, one container behind both.
Do I need this for a language site on another country domain?
Only if visitors move between them mid-session. Separate audiences that never cross do not need linking, just their own domains.