Blogs

Removing Referral Spam From Google Analytics Reports

By Michael Fridman posted 08-11-2015 09:19 AM

  

Referral spam is something we’re being asked about more and more – what is it, and how do we get rid of it? While there’s no perfect solution, there are some great ways to minimise the impact of referral spam on your Google Analytics data quality. Get started with our quick guide to removing referral spam.

What is referral spam?

Referral spam is any traffic that shows up in your Google Analytics account which does not represent genuine users browsing your website. Some examples you might have seen in your accounts include semalt.com, buttons-for-website.com and 100dollars-seo.com; but there are hundreds of others. Individually, most of them don’t generate too many sessions but taken together they can add up:

How does referral spam work?

Most legitimate web bots (eg. the bots written by search engines to crawl your website) don’t run the Google Analytics Javascript code, and therefore do NOT end up in your Google Analytics reports. However, a number of websites have taken to writing bots and other technologies that end up in your Google Analytics reports (whether intentionally or otherwise). While the motivation behind spam is varied, for many it seems to be the generation of curiosity-based traffic back to the spammer’s website.

How can referral spam be blocked?

At the view level, Google Analytics let you exclude all hits from known bots and spiders.

While this will remove some of the spam automatically, it currently does not remove everything. However, you can also create view filters to exclude traffic from certain referrers. Below is an example of a filter that has been created to exclude traffic from semalt.com (or any website with ‘semalt.com’ in the website name):

A few important things to remember:

  • View filters do NOT apply to historical data.
  • Filters are permanent so if you make a mistake you could wipe all of your data. For this reason, it’s crucial to use the filter verification option when creating a filter, and to apply the filter to a test view of your Google Analytics data first.
  • The filter pattern used here is a regular expression. To learn more about regular expressions, check out our regex cheat sheet.
  • Because Google does not have a completely automated solution, every spam referrer has to be specified explicitly by name.

Does this mean I might need to filter out dozens of referrers?

Unfortunately yes. Luckily, this is a collective problem so there’s a few resources out there. One great resource at Lone Goat that has a list of 77 spam referrals, including the regular expressions which let you remove them using 7 filters.

That said, new spam referrers are popping up all the time – since the Lone Goat post was published in May there have been lots of new ones. There is a community-contributed list at GitHub which at the time of our publication listed 271 spam referrals. The GitHub project is here; from which you can click through to the list. (Note that many websites and even domain names are NSFW!)

To create a Google Analytics filter for these, string a bunch of the spam referrers together separated by a pipe (|) and put a backslash (\) before every dot (.). This would give you a regular expression such as the following, to create a Campaign Source exclusion filter from:

0n-line\.tv|100dollars-seo\.com|12masterov\.com|1pamm\.ru|4webmasters\.org

Note that as regex for filters needs to be 255 characters or less, you may need to create multiple filters.

If this sounds laborious, that’s because it is. Fortunately, Simo Ahava’s come up with a great script to add these filters to your account automatically – you’ll just need to authorise the script. You can run it from simoahava.com/spamfilter/. Note that the script is based on the shorter Lone Goat list of 77 spam referrals, not the longer GitHub list.

What can I expect to see in my Google Analytics account?

Although referral spam seems to account for less than 2% of all traffic on average, this depends on your website profile. For smaller websites, the traffic may drop by more than 2%, but it does mean that the data in the accounts will be more meaningful. This is another reason to set up these filters in a testing view first to see what impact this has on your reporting.

Have you seen other spam referral sites in your Google Analytics account? Let us know in the comments.

Permalink

Comments

08-14-2015 08:06 AM

We have a whole thread about this plague in the GA G+ Community, see http://goo.gl/zvvkEW - there are good articles and tools. Also, note that whenever you can, it's better to use an Include MyValidHostNameOnly.com and that will get rid of any bad ones as they come.

08-11-2015 09:28 PM

Thanks for the great article! This has been a real problem for me. Also, thanks for the tip, Lea. I am using your discovered spam blocker site and it also seems to be working for me!

08-11-2015 04:09 PM

Sadly, rate limits often get the better of tools like Referral Spam Blocker and Simo's Spam Filter Installer.
Here are some referral sites that we also block:
10bux, e2click, success-seo

08-11-2015 03:15 PM

Thanks for the article, Michael. I'd like to mention a new tool I just discovered by Werner Bastianen at Stijlbreuk called Referrer Spam Blocker (http://referrerspamblocker.com/). It connects to your account and applies the most well-known referrer offenders. I'm testing it currently and it seems to work well, and it's continually being updated. Something to take the sting out!

Most Recent Blogs

Log in to see this information

Either the content you're seeking doesn't exist or it requires proper authentication before viewing.