How to deal with referral spam in Google Analytics

Have you spotted referral spam aka “Ghost Spam” in Google Analytics?

The first hint that something suspicious might be going on would be a sudden increase in traffic in Analytics. For our low traffic website, this was pretty obvious to us. We noticed three sources in particular when looking under Acquisition/Source/Medium. Here’s an incomplete list of some of the ghost spam domains we’ve come across: / referral / referral (numerous variants) / referral / referral / referral / referral / referral seems to be bringing in the largest number of fake referrals so far and appears as many different numbered sub-domains. These fake referrals will usually be accompanied by a 100% bounce rate and Avg. Session Duration of zero. Highly annoying and the best course of action to take would be to block the source on 2 fronts.

How Do You Block Referral Spam?

First off, referral spam doesn’t appear to be particularly harmful, but it is very annoying and we’d just rather not see it at all. Thankfully, there are some options:

1. Filter it:
Filter out the referral spam source domains from Google Analytics so that you no longer see it and so it doesn’t mess with your stats.

2. Block it:
Block the offending domains by adding a RewriteCond directive to your .htaccess file. This is an effective method, although some people are less than comfortable manually editing this file.
The problem with this method is that there are ALOT of spammers out there. Once you start blocking offending ip addresses and domains, you may end up going down the rabbit hole and spending more time blocking domains than you’d planned. Just take a look at this huge referrer blacklist.Note that this list is by no means complete,and you can never really keep up to date. Unless…

3. Ban it: Use a WordPress plugin to do the heavy lifting for you. This is by far the easiest way to ban/block referral spam. At the moment of this writing, I’ve looked at the following  plugins for banning and blocking referral spam.

WordPress Plugin Breakdown

Block Referer Spam by

The principle behind this plugin is simple: Install it and you will no longer see weird referrals in Google Analytics. The only issue is that there are no options or stats, so you can’t tell if the plugin is working or not. Well, it’s more of a case of, if you don’t see anything funny in GA after installing this plugin, then that means it’s working. After installing this plugin, give it a few days and keep an eye on Analytics to see if the spam referrers taper off.

Bot Block by Sean & Ricky Dawn

This plugin does offer some transparency in that you can see what’s been blocked and you can also add offending domains to the database. The only caveat is that setup is a 2-step process in that you first need to setup a filter in GA before Bot Block can do its job. The Bot Block option page offers a simple tutorial to help out.

SpamReferrerBlock by Didier Sampaolo

SpamReferrerBlock also allows you to add custom domains and also recommends adding a filter in Google Analytics. They have a disclaimer in the plugin stating that their plugin “can’t remove ALL spam referral traffic“. This unfortunately is a hard fact of the Internet circa 2015.

Effectively, setting up a filter in GA in conjunction with one of these WordPress referrer spam plugins is your best bet to keeping referral spam at bay.

2 thoughts on “How to deal with referral spam in Google Analytics

  1. Hey,

    Thanks for mentioning our plugin (Bot Block by Sean & Ricky Dawn) – when you say ‘The only caveat is that setup is a 2-step process’ it’s not really if you only want to block the spam that actually arrives at your site, we offer the video and guide for people to be able to block 100% of the spam.

    It’s hard to explain but there are two types of referral spam, one type that actually crawls your site (this is the spam that the plugins can block) and then the other type of spam is where spammers just ping your UA number from their own domains which means the traffic doesn’t actually arrive on your site which in turn means it is impossible for any of these plugins to block it. The only way to block that spam is by setting up a filter within Analytics 🙂

    So if you don’t setup the filter our plugin will block the same (if not more since we have a user generated spam list) amount of spam traffic as any other plugin – does that all make sense?

Leave a Reply

Your email address will not be published. Required fields are marked *

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