Sub topic 10
Configuring the unwanted referrals list
A referral is a visit that arrives after a user clicks a link on another website. GA4 records the referring website as a traffic source. This is useful when the source is a partner or publisher. It becomes misleading when a payment provider or authentication service sends users back to your site.
For example, a user might arrive from a search ad, go to PayPal, and return to your confirmation page. Without an unwanted referral rule, GA4 may attribute the return visit to paypal.com instead of the original campaign. This can create self-referrals, split sessions, and undercount important marketing channels.
How GA4 handles referral sources
GA4 reads the referring page when a session begins. It compares the referral domain with the domains in your unwanted referrals list. If the domain matches, GA4 ignores that referral as a source.
The list changes attribution. It does not delete events, users, or sessions from your reports. It also does not remove the payment provider from every report if the provider appears in another parameter or event value.
Add a payment or authentication domain
You need Editor or Administrator access to the GA4 property.
- Open Admin.
- In Data collection and modification, select Data streams.
- Select the relevant web data stream.
- Open Configure tag settings.
- Select Show all.
- Select List unwanted referrals.
- Add a condition for each domain.
- Save the configuration.
Add the domain that appears as the referral domain in your reports. For a payment provider, this may be paypal.com, stripe.com, or a regional provider domain. Authentication flows may use a separate identity domain, such as login.example.com.
Prefer a rule that covers the provider's legitimate subdomains without matching unrelated domains. If the interface supports regular expressions, this pattern matches paypal.com and its subdomains:
^(.+\.)?paypal\.com$The escaped dots matter. An unescaped dot in a regular expression can match almost any character.
| Situation | Example rule | Reason |
|---|---|---|
| One exact host | `checkout.example.com` | Limits the rule to one host |
| A provider domain and subdomains | `^(.+\.)?paypal\.com$` | Covers the root domain and subdomains |
| A domain shared with unrelated services | Use the exact host | Avoids hiding useful referrals |
Choose the right domains
Inspect the Session source and Session medium dimensions after a transaction or login flow. Look for domains that appear unexpectedly after users return to your site. Add only domains that should not receive attribution.
Common candidates include:
- Payment gateways that redirect users back after checkout
- Hosted payment pages
- Identity providers used during sign-in
- Consent or verification services that return users to your site
- Subdomains that belong to your own organization
Do not add search engines, advertising platforms, partners, or affiliates unless you have confirmed that their referrals should not receive credit. An unwanted referral rule can hide a real acquisition source.
Cross-domain measurement and validation
An unwanted referral rule is not a replacement for cross-domain measurement. If users move between domains that you control, configure cross-domain measurement so GA4 can preserve the same user and session when appropriate. Use the unwanted referrals list when a third-party domain should be ignored as a source but cannot be part of your measurement setup.
After saving a rule, complete a controlled transaction or login test. Check the resulting session source and medium. Confirm that the payment or authentication domain no longer appears as the session source. Test both successful and failed returns because different paths may use different hosts.
Keep an audit record with the domain, reason, date added, and person who approved the change. Review the list when a provider changes its checkout, login, or redirect domains.
Exercise
A user arrives through an email campaign, pays on checkout.example.com, and returns to your site. GA4 records checkout.example.com as the session source. What should you do?
Show answer
Confirm that checkout.example.com is only a payment or return service, add its domain to the unwanted referrals list, then run a new controlled test. Do not expect the change to repair historical sessions.