[UA] Filter domain referrals

Reduce spam traffic from your Analytics data.
This article is about how to filter domain referrals in Universal Analytics. For information about how to identify unwanted domain referrals in Google Analytics 4, go to [GA4] Identify unwanted referrals.
Referral traffic is the segment of traffic that arrives on your website through another source, like through a link on another 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.

You can create a filter that excludes traffic referred from selected domains. When you exclude referrers in this way, you are preventing all hits originating from those excluded websites from being part of your Analytics traffic. One reason to do this would be to prevent spam hits from polluting your legitimate hit data. A referral exclusion filter works by comparing the filter pattern you provide with the hit values found in the Campaign Source dimension.

Filtering domain referrals is different from the Property level referral exclusion feature. Filters remove the hits from your traffic stream, so no sessions from those hits will be recorded. Referral exclusion, on the other hand, treats hits that are referred from the excluded sources as direct traffic.

Exclude a single referrer

  1. Follow the instructions to create a new filter for your view.
  2. Set the Filter Type to  Custom.
  3. Click the Select filter type drop-down menu and select Exclude.
  4. Set the Filter field to Campaign Source.
  5. Enter a Filter Pattern containing the domain of the referring source which you would like to exclude. For example, some-spam-site.com.

Exclude multiple referrers

Use a regular expression in the Filter Pattern field to exclude several referring sources:



In the example above, the pipe symbol | is used as an "or" operator, meaning filter example.com OR secondexample.com OR the .*spammysubdomain.com. Don't end the filter pattern with a pipe, as that will exclude ALL referral sources.

Related resources

Was this helpful?

How can we improve it?
Choose your own learning path

Check out google.com/analytics/learn, a new resource to help you get the most out of Google Analytics 4. The new website includes videos, articles, and guided flows, and provides links to the Google Analytics Discord, Blog, YouTube channel, and GitHub repository.

Start learning today!

Clear search
Close search
Google apps
Main menu