Sub topic 12
Fixing self-referrals with referral exclusions and cross-domain setup
Prerequisites
Assume you know how to open a GA4 property, inspect a web data stream, and edit either Google tag settings or Google Tag Manager. You also need access to every domain that belongs to the same customer journey, such as www.example.com and shop.example.com.
A self-referral occurs when GA4 records your own domain as the source of a visit. For example, a user starts on www.example.com, moves to shop.example.com, and then appears in a report as shop.example.com / referral. This often creates a new session and gives the second domain credit for the visit.
Why self-referrals happen
GA4 keeps session continuity with first-party cookies and, for linked domains, a linker parameter added to the URL. Self-referrals commonly result from:
- Cross-domain measurement not being configured.
- A redirect removing the linker parameter.
- Different tagging or measurement IDs on related pages.
- A payment or booking service sending the user back without preserving measurement information.
- Consent settings or browser restrictions preventing the original cookie from being read.
- A page on the same domain loading a different GA4 configuration.
The fix depends on whether the domains are part of the same journey.
Configure cross-domain measurement first
Use cross-domain measurement when you control the domains and want them to share one session. In the web data stream, open Configure tag settings, choose Configure your domains, and add each relevant domain.
With a Google tag installed directly, the equivalent configuration looks like this:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-XXXXXXX', {
linker: {
domains: ['www.example.com', 'shop.example.com']
}
});
</script>Replace the measurement ID and domains with your own values. Test links between domains and confirm that the destination URL briefly contains a linker parameter. Then use DebugView or Realtime to check that the journey remains one session.
Add referral exclusions for expected handoffs
Use an unwanted-referral rule for a domain that should not take attribution credit, such as a payment provider that sends users back to your confirmation page. In GA4, open Admin, choose Data streams, select the web stream, and edit List unwanted referrals.
Referral exclusions prevent a known domain from appearing as the referral source. They do not transfer cookies, preserve a session, or replace cross-domain setup.
| Situation | Best action |
|---|---|
| Two domains are part of your website | Configure cross-domain measurement |
| A payment provider returns users to your site | Configure the journey, then add the provider as an unwanted referral if appropriate |
| Your own domain appears as referral | Check linker parameters, tags, redirects, and consent before adding an exclusion |
| An unknown external site appears as referral | Investigate it before excluding it |
Exercise
A user moves from www.example.com to checkout.example-pay.com and returns as a new session attributed to the checkout domain. What should you check first?
Show answer
Check cross-domain measurement, consistent tagging, linker parameters, redirects, and consent behavior. Add an unwanted-referral rule only after confirming that the checkout domain should not receive attribution.