Cross-domain measurement between your app and your marketing site
•6 min read
A signup that starts on your marketing site and finishes in your app is two users in GA4 unless the domains are configured together. Here is what the setting does and what it cannot fix.
Cross-domain measurement is the GA4 setting that lets one person be counted once as they move from a marketing site on one domain to a product on another. Without it, Analytics creates new cookies with new IDs for each domain, so the same visit is split into two users and two sessions, and the second one arrives as a referral from the first. With it, the cookie IDs are carried across in a URL parameter named _gl when the user follows a link or submits a form between the configured domains. Two conditions have to hold: the Google tag must be on every page of both domains, and both must use the same tag ID from the same web data stream.
Where is the setting?
In GA4, cross-domain measurement lives on the web data stream rather than on the property. Open the stream's details, choose Configure tag settings at the bottom, then Configure your domains, and add a condition under "Include domains that match the following conditions". Domains that already carry the same Google tag are detected and offered under Recommendations, which is the shortest path when the tag is deployed everywhere. Making the change requires the Editor role or above on the Analytics account.
What the _gl parameter does, and when it is missing
The link decoration is the whole mechanism. When the tag on the first domain sees a link or a form pointing at a domain in the list, it appends a _gl parameter carrying the identifiers, and the tag on the receiving domain reads it and keeps the same client ID instead of minting a new one. That means the identity survives navigation the tag can see, and only that. A user who types the second address by hand, follows a link from an email that strips parameters, or lands after a server redirect that drops the query string arrives with no _gl and is counted as new.
One side effect is worth knowing before you read the reports. Outbound clicks that would ordinarily be recorded by enhanced measurement are ignored when the outbound link points at a domain listed in cross-domain measurement. The click is no longer an exit from your site, it is a step inside one journey, so an outbound click count that falls after this change has not broken; it has stopped double-counting a transition you now measure as continuous.
A consent banner changes what GA4 can measure, and the reports carry no marker saying so. What the seven consent types cover, what basic and advanced consent mode each do when someone declines, and how to read numbers collected under either.
Market4 turns one release note into a changelog page, a blog post, a mail-out and a week of social posts — and then tells you which of them brought anyone back.
No card to start. Cancel from the settings screen, not from an email.
Do I need this for a subdomain?
Not usually, and sometimes yes. A product on app.example.com and a marketing site on example.com normally share the same cookie domain, so the identity carries without any of this. The case that needs configuration is a subdomain whose tag writes a different cookie domain: navigation between the two then behaves like navigation between separate sites, and a self-referral shows up in the reports. Google recommends the same domain configuration for that case, and a self-referral in the acquisition report is the signal that it applies to you.
When cross-domain measurement is needed and what has to be true for it to work.
Arrangement
Same cookie identity by default?
What to configure
example.com and app.example.com, same tag, default cookie settings
Yes
Nothing; verify no self-referrals appear
example.com and app.example.com, different cookie domains
No
List both domains in the data stream's domain conditions
example.com and separate-product.com
No
Same tag ID on both, then list both domains
example.com and a hosted checkout on a vendor domain
No
List the vendor domain, and confirm the vendor keeps the _gl parameter
What it does not fix
Cross-domain measurement joins two web domains that both run your Google tag. It does not join a website to a mobile app, it does not recover a session that began before the tag was installed, and it does not survive a user clearing storage or arriving in a browser that blocks the cookie. It also cannot repair history: the setting takes effect for traffic collected after it is saved, so the split users already recorded stay split. Treat it as an instrument that starts measuring correctly from today, not as a correction applied to the archive.
Consent is the other constraint to plan around. Analytics uses first-party cookies to set the identifiers that cross-domain measurement carries, and it does so when there is consent, so a visitor who has not granted it is not stitched across domains no matter how the streams are configured. That is the intended behaviour rather than a fault, and it is a reason to read cross-domain numbers as a floor.
How to verify it is working
Open the marketing site with the Analytics debug view running, and click the link that crosses to the other domain.
Look at the address bar on arrival: a _gl parameter should be present. If it is not, the link is not one the tag decorated, or the destination domain is not in the conditions list.
Check that the session on the second domain continues rather than starting, and that the first domain does not appear as its referrer.
Check the reports a day later for self-referrals from your own domains. A self-referral surviving the change means one page on that domain is missing the tag, or is loading a different tag ID.
Do both domains need the same GA4 property, or the same tag?
Both. The Google tag on each page of each domain has to use the same tag ID, the G- identifier from the same web data stream, because the identity being carried belongs to that stream. Two properties, or two streams within one property, mean two sets of identifiers, and no domain configuration joins them. Sending a second copy of the traffic to another property is a separate decision and does not affect the stitching.
Why do I still see my own domain as a referral source?
A self-referral means a page started a new session without recognising the visitor, so the previous page's domain was recorded as the referrer. The usual causes are a page missing the Google tag, a page loading a different tag ID, a navigation that dropped the _gl parameter such as a server-side redirect, or a domain that was never added to the conditions list. Find the landing page of the self-referred sessions and check which tag it actually loads.
Does cross-domain measurement work for links inside an email or an ad?
No, because the decoration happens in the browser when the Google tag sees a link on a page it is running on. A link in an email or an ad is not decorated, so the visitor arrives as a new user on whichever domain the link points at. Attribution for those visits comes from campaign parameters instead, which is a different mechanism with a different job: campaign tags say where a visit came from, cross-domain measurement says two visits are one person.
Will listing a domain I do not own cause a problem?
It changes how links to that domain are treated: outbound clicks to it stop being recorded as outbound, and links to it get decorated with a _gl parameter that the receiving site will ignore unless it runs your tag. So listing a domain you do not control mainly removes an outbound-click measurement you probably wanted. Add a third-party domain only when that domain genuinely carries your tag, such as a hosted checkout you configured.
First click, linear, time decay and position-based were withdrawn in November 2023. What remains in the GA4 attribution reports is data-driven, paid and organic last click, and Google paid channels last click — and one of the three is still the one arguments end on.
A server container is a service you now operate: a host, a domain, a deployment and someone to notice when it stops. Here is what that buys, and when it does not buy enough.
Ga4Server-side taggingGoogle tag manager
GA4 cross-domain measurement: app and marketing site