GA4 & GTM Developer

Optimizer Troubleshooter

Follow me on
Category | Google Analytics
Difficulty |

Exclude Irrelevant referrals using a Campaign Source Filter

This filter is only recommended for irrelevant referrals that are not spam, for example, responsive testing sites, URL openers. To take care of all spam there is a more efficient solution.

From time to time, you will find hits from referrals that are not relevant to your Analytics, for example testing sites like mobile friendly tests or spam (this method is no longer recommended for fake traffic, instead use this guide)

No matter the reason as to why you consider the source irrelevant, you can easily exclude them to keep your Analytics data relevant.

How to create a filter to exclude irrelevant referrals

  1. Go to the Admin section of your Analytics
  2. Select Filters (from the column View) and the +Add a new filter
  3. Enter Exclude Irrelevant Referrals as a name
  4. In Filter Type - Custom
  5. In Filter Field (dropdown) - Search and select Campaign Source
  6. Filter Pattern (text box) - Copy the name of the source/referralHow to Create an Exclude filter for Crawler Spam in Google Analytics
  7. [OPTIONAL] You can test your filter by clicking verify this filter at the bottom of the screen. If you get the message "This filter would not have changed your data...", first check the filter configuration. If everything is OK, it just means that the tool didn't find any match in the sample data.
    If you want more information about the verification feature and a more precise way of testing your filters check the following article
  8. Once you are sure everything is ok, Save the filter.

Normally, the filter will start working in less than an hour, but officially it can take up to 24 hours before the changes start to show. If, after this time, you are still seeing new occurrences after that time, check the configuration of your filter.

What if I want to exclude more than one referral

If you have multiple referrals, don't create one filter for each, or your filter screen will soon become untidy. Instead, keep adding them to the same filter separated by a pipe "|" until you reach the character limit (255). After that, you will need to create a second filter. For example:||
Just make sure that you don't leave any space or extra pipes "|" at the end or beginning of the expression.
Be the first to comment :)