[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.

Automatic self-referral detection

A self-referral is referral traffic that can originate from pages within your own domains. By default, Analytics will not identify traffic as referral when:

  • The referrering website matched the same domain of the current page or any of its subdomains (e.g. your own website).
  • The referrering 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.

Configure unwanted referrals

To configure unwanted referrals, you need the Editor role on the property.

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

  1. In Admin, under Data collection and modification, click Data streams.
  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
Google apps
Main menu
15488676288114893872
true
Search Help Center
true
true
true
true
true
69256
false
false