Google Analytics Referrer Spam Filters

Having correct data to base marketing decisions on is essential, and Google Analytics provides that data. Unfortunately there are many who market dishonestly which hurts your analytics data in the form of referrer spam. Essentially referrer spam are bots that are sent to your website. These bots have different purposes, but the result is the same. You’ll have incorrect data. These bots will:

  • increase your bounce rate, how many users come to your site and leave almost immediately
  • overall sessions
  • decrease your goal conversion rate
  • and more.

To combat spam, there are two simple filters you can put in place. These are a crawler spam filter and a ghost spam filter.  We’ll go over how to implement each of these filters respectively.

Crawler Spam Filter

  1. Go to your Admin tab
  2. Under View Column Select Filters
  3. Click on New Filter
  4. Enter Crawler Spam Filter as name
  5. Configure the filter:
    • Filter Type: Custom
    • Filter Field: find and select Campaign Source
    • Filter Pattern text box: Enter the Crawler Spam expression
  6. Hit Save
  7. Repeat for each Crawler Spam Expression creating a name such as “Crawler Spam Filter 2” and so on


Crawler Spam Expressions:

Please click on the following link which should take you to the section that shows the various crawler expression.  As of July 6, 2018 there are 5 expressions listed on their website.

The Ultimate Guide to Stopping Google Analytics Spam, Bots and Other Junk Traffic

Ghost Spam Filter

If the client has an established Analytics:

  1. Go to the Reporting section in Analytics and set time-frame calendar to 1 year (if it’s the property has less than a year select everything).
  2. On the left-hand sidebar select Audience.
  3. Expand Technology and select Network.
  4. At the top of the report make sure you select Hostname (by default Service Provider is selected)
  5. You should have at least one valid hostname, which is your main Domain. The rest will depend on the configuration of your site and all the services where you added your tracking code ->UA-XXXXXX-1.
  6. Make a list of your valid hostnames. If you want to exclude any non-spam hostnames from your reports DON’T add them to the list.
    Note: Often spammers will use known services such as as a hostname to trick you. If you don’t have any of your services or GA code on a site it shouldn’t be a hostname.
  7. Create an Expression (REGEX) that matches all of them. Understand REGEX.
    It may look something like this: sebomarketing|translatingservice|webcaceservice
    It is crucial that you add all the relevant hostnames. Otherwise, you may lose out on valid data.
  8. Go to the Admin tab and select the View where you want to apply your filters
  9. Select Filters in the last column “View”.
  10. Select New Filter
  11. Select Create New Filter and enter Include Valid hostnames as a name.
  12. In Filter Type select Custom
  13. Make sure to choose INCLUDE and select Hostname from the drop-down.
  14. Paste, the Hostname REGEX that you build previously in the Filter Pattern field.
  15. Select Verify this filter. Make sure you are not filtering out any valid hostnames and save.

If you are setting up a new client without Analytics:

  1. Skip going to the Network Hostname section
  2. Do everything the same when setting up the Valid Hostname Filter
  3. In the Filter Pattern field add a very simple expression that contains the domain without the “www” or “.com” and googleusercontent. If you were doing it for it would look like this: sebomarketing|googleusercontent
  4. Set a calendar event for a couple months in the future to look at the non-filtered view and add hostnames that are applicable to the valid hostname filter in the filtered view.