[GA4] Identify unwanted referrals

This article is for website owners who need unified measurement across more than one domain, e.g. across a customer website and a separate shopping-cart domain, and don't want that traffic categorized as referrals. This article pertains to Google Analytics 4 properties; if you are using Universal Analytics, read this article instead.

Referrals are the segment of traffic that arrives on your website through another source, like through a link on a third-party domain. Analytics automatically recognizes where traffic was immediately before arriving on your site, and displays the domain names of these sites as the referral-traffic sources in your reports.

To make sure your data includes only referrals in which you're interested, you can create a set of conditions that identify the domains whose traffic you don't want to identify as referrals.

When you create these conditions, Analytics evaluates events sent from your website and appends the ignore_referrer parameter with a value of true to every event that matches the conditions (ignore_referrer=true). This parameter indicates to Analytics that the referrer should not be displayed as a traffic source.

The conditions are evaluated for every web page on which you have the Google tag.

Common uses

The following examples illustrate scenarios in which you would not want to identify traffic from a domain as referrals:

  • Third-party payment processors

    An ecommerce site that uses a third-party payment processor, and users return to your site after checking out on the third-party domain.
  • Website-managed interactions

    Transactions that are managed through a website but involve different third-party domains, e.g. a password-recovery operation that sends an email to users and there is traffic from the email domain back to the website. In this context, the email domain is acting as an aspect of your business rather than as a source of traffic.

Why returning users from excluded domains still appear in your reports

  • User A arrives at your site via a referral from Domain B before you add that domain to the Referral Exclusion List.
  • That first session is attributed to Domain B.
  • You add Domain B to the Referral Exclusion List.
  • User A returns directly to the site, for example, via a bookmark.
  • Because of the last-non-direct-click attribution model, this second session is also attributed to Domain B.
    Note: The key event lookback window you choose also applies to session attribution.

Automatic self-referral detection

A self-referral is referral traffic that can originate from pages within your own domains. By default, Analytics doesn’t measure the source / medium as a new referrer if the traffic is self-referring rather than a no-referrer.

Additionally, Analytics will not identify traffic as referral when:

  • The referring website matched the same domain of the current page or any of its subdomains (e.g. your own website).
  • The referring website is a result of a cross-domain measurement setup, e.g. when a user navigates across domains that you have configured in your domains list and the current page contains the linker parameter _gl.

Example

To illustrate the self-referral exclusion feature, imagine a session on example.com referred by the source / medium “example.com / referral”. Since “example.com / referral” is considered a self-referral, Analytics would not count this as a new referrer.

Configure unwanted referrals

You can configure a maximum of 50 unwanted referrals per data stream.

  1. In Admin, under Data collection and modification, click Data streams.
    Note: The previous link opens to the last Analytics property you accessed. You can change the property using the property selector. You must be an Editor or above at the property level to configure unwanted referrals.
  2. Click Web and then click a web data stream.
  3. In the web stream details, click Configure tag settings (at the bottom).
  4. In the Settings section, click Show all to see all available settings.
  5. Click List unwanted referrals.
  6. Under Include referrals that match ANY of the following conditions:
    • Choose a match type.
    • Under Domain, enter the identifier for the domain you want to match (e.g. example.com).
    • Click Add condition to add another domain.
    Conditions are evaluated using OR logic.
  7. Click Save.

Set ignore_referrer=true for individual events

You might need to ignore referrers only in certain situations. You can control when you want to ignore a referrer by appending the ignore_referrer parameter to individual pages or events and setting it to true. For example, to ignore a referrer on a specific page, add the parameter to the config command:

gtag('config', 'G-XXXXXXX', {
  ignore_referrer: 'true'
});
Most site owners will not need to do this. We don't recommend appending the parameter manually if you don't understand the implications. Do not set this parameter up on all pages of your website: you may lose valuable information regarding your traffic sources.

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Main menu
1960038661888524095
true
Search Help Center
true
true
true
true
true
69256
true
false