How To Block Google Analytics Spam Traffic With These Tools

by Today's Eggspert

Last updated on July 25th, 2017

Analytics spam was one of the hot analytics topics in 2015 (peaking during the summer of 2015). It seems the topic regained some popularity during November and it appears that the traffic spam problem is not over just yet.

google graph

Google Trend for Analytics Spam

Google created a traffic spam support page, so this means they see the problem and might come up with a solution. Adam Singer from Google Analytics confirmed Google will try to fix the issue, however the release date is not known yet.

We analyzed 292 Google Analytics accounts which had no spam filtering setup and had at least 25 referrer visits per day. The overall referrer spam traffic was about 11% and about 57% of all websites had spam traffic from at least one of the 500 spam domains.

ip spam

Image Source

I will not go into detail about types of spam, as it has been discussed many times. However, you should check out Scott Hendison’s PubCon presentation on about Google Spamalytics.

Keeping New Traffic Clean With Automated Tools

Most solutions that help you to keep your Analytics statistics clean of spam require some kind of (manual) filtering of spam domains, as well as some more generic filtering within Google Analytics.

Currently, there are about 550 domains which cause the spam problem (the latest list of spam domains can be found at GitHub, which is open source).

Because of a large number of spam domains, applying filters by hand has become very time-consuming and because new spam domains are popping out of thin air every month, it is difficult to keep track.

To keep up with the spam growth, tools were created. There are several tools on the market today, most of which are free.

Below I will outline several tools. *Note: Most of the tools are limited by quota limits from Google, so if a tool gives a quota error, try another one or wait 24 hours.

Analytics Referrer/Ghost Spam Blocker

adwords robot

This spam blocker is always up-to-date. At the time of writing, it contains 550+ blacklisted domains in their list.


  • Simple interface with search option (great if you have a lot of views)
  • Can update multiple accounts, properties and views easily
  • Undo added filters if needed
  • Always up-to-date thanks to the help of their community (550+ blacklisted domains, 39 filters)
  • They have increased quota limits to 10000 requests per day


  • You need to update the filters each time new domains are published

Analytics Toolkit

analytics toolkit

Analytics Toolkit isn’t a free tool ($15 per month), but the low price is worth the headache it relieves. This spam tool is part of a broader range of Analytics tools provided by Analytics Toolkit.



  • Filters are automatically updated when new domains are released
  • Apply filters on all accounts, properties and views
  • One click interface
  • Quota limits are not a problem because filters are applied in the background


  • Registration needed
  • The number of filtered domains is unpublished (5 filters are added)

Spam Filter Installer

spam filter installer

Spam Filter Installer (free & open source) by Simoa Hava is one of the first automated spam filter tools. The whole tool is open source and can be downloaded and implemented by anyone. This way you have better control of quota limits.



  • Open source code, you can implement the tool yourself
  • Multiple properties and views can be selected


  • Can only be applied on one account at a time
  • Quota limit of 2000 writes per day
  • The number of filtered domains is semi up-to-date (400+ domains, 26 filters)

Referrer Spam Blocker

referrer spam blocker

Referrer Spam Blocker is a free tool by Stijlbreuk. It definitely has one of the better looking user interfaces of the tools out there.



  • Multiple properties and views can be selected
  • Increased quota limits to 5000 requests per day


  • The number of filtered domains is semi up-to-date (203+ domains, 17 filters).

How the tools work and which filters are used

Most of the tools above add one or more of the following filters. Let’s go through how they work.

Exclude Empty Hostname

hostname is not set

Most ghost spambots do not send the hostname field when sending fake data to analytics.

This filter will remove all requests which have an empty hostname.

Exclude Empty Screen Resolution

Most ghost spambots do not send the screen resolution when sending fake data to analytics.

This filter will remove all requests which have an empty screen resolution.

no screen resolution

Include Only Own Hostnames

Most ghost spam bots do not set the hostname, but some of them do. In most cases they set the hostname to a spam domain instead of the real domain of the website.

not our hostname

This filter filters out all requests which have the hostname set to anything other than the list of hostnames we provide (for example, your own domain name).

CAUTION: Because this is a whitelist filter, i.e. it filters out everything out except the list of names we provide. It has a downside: if you change your domain in the future or you are using multiple domains with the same analytics account (like for each language TLD or with multiple subdomains) you might filter out the good traffic. So be very careful with this filter or you might not detect a lot of real traffic in your analytics account.

Though this sounds great, this filter is not the holy grail, some spam bots are actually visiting your website, so the hostname will be set to the correct hostname and will not be filtered out.

correct hostname

Exclude Blacklisted Domains (Campaign Source Filter)

When none of the above filters work, you must exclude each and every known spam domain by hand. Currently, there are more than 550 known spammy domains in the open source spam list.

Most tools use some list of domains which are automatically added.

Remove Spam From Already Polluted Traffic

Using methods described above it is not possible to clean up already polluted data (in Google Analytics). Google Analytics supports segments which allow you to filter old data, but not to update it.

By using the segment below, you can hide all spammy domains from older data. It comes in handy if you had a lot of spam in the past and you didn’t filter it.

Just import Analytics Spam Blocker (Jan. 2016, 550 domains) and you will be able to select the segment in any view. Check how to use segments guide from Kissmetrics if you are new to segments.

Other (Not Recommended) Solutions

There are some other solutions which might partially work. Most of them I would not recommend as they tend to break things more than they fix them. As a matter of fact, most of them will not work any better than the automated solutions above.

Adding Custom Dimensions To Each Visit (Not Better Than Filters Above)

Adding a custom dimension to each visit will allow you to distinguish between ghost spam and real visits. This solution requires access to the analytics code on the website.

Excluding Domains Using .htaccess (Not Recommended)

Excluding traffic at web server level will not take care of ghost spam. You also need to use Apache web server (or another web server which is compatible) and have access to its settings. Updating these rules can bring down the whole website – so be careful. Also checking 500+ regexes at each visit needs extra resources.

Adding Extra Parameters The Page View Trigger (Not Recommended)

To add an extra parameter to the page view request you will need access to your analytics code on your website. Playing around with that is not advisable either.

Create A New Tracker ID (Not Recommended)

Creating a new Google Analytics tracking ID is not a good idea because you will lose all of your older data. Furthermore, spam bots will find your new account and will start adding spam.

Filter Out IP Addresses (Not Recommended)

Filtering out IPs will not be very helpful because bots use different IPs.


Analytics traffic spam is still a problem, but automated solutions are here to help. These tend to work well and are easy to use. There are also plenty of choices.

Google is also working on a solution, which hopefully will solve the problem once and for all. But at this time, there is no release in sight.

Found new spam domains? Submit them to community blacklist at GitHub. Other tips & tricks are welcome in the comments.

About the Author: Dennis is the founder of AdWords Robot where AdWords Audit software and AdWords automation tools are being developed. He writes about practical applications of AdWords, analytics, growth hacking, e-commerce and conversion optimization. He loves coding, squash and movies.

One Comment


Get updates on new articles, webinars and other opportunities:

Today’s Eggspert

This article was written by today's Daily Eggspert. If you would like to contribute as an Eggspert, please reach out to us here.


Comment Policy

Please join the conversation! We like long and thoughtful communication.
Abrupt comments and gibberish will not be approved. Please, only use your real name, not your business name or keywords. We rarely allow links in your comment.
Finally, please use your favorite personal social media profile for the website field.


Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Awaz says:
    January 2, 2017 at 11:44 pm

    Thanks for article.
    Recently I got more than 40% of my site traffic from this spam. Major of them coming through Russian trump support. It is became headache for us webmaster. It create more bounce rate for my site.
    Thanks to your advice I applied first option for my site, but still waiting for its result.
    By the way I have query. Is this fake traffic and bouncing traffic will ruin my google and alexa rankling ?

Show Me My Heatmap

Playing around w/ @CrazyEgg and like it so far. Quick, nice and simple. Also easily implementable with #googletagmanager built-in tag.

Brandon K. Lee


What makes people leave your website?