Search
Clear search
Close search
Google apps
Main menu

Filter domain referrals

Reduce spam traffic from your Google Analytics data.
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 Google 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:

Example:

example\.com|secondexample\.com|.*spammysubdomain\.com
 

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 article helpful?
How can we improve it?
Google Analytics training and support resources

Check out our comprehensive list to learn more about Analytics solutions.