Today we're going to talk about spam. Unfortunately not the rather tasty food staple, or even email spam, but referral traffic spam.

The stuff that's probably going to be blighting your Google Analytics account.

So, here's an explanation of what it is, and three steps that I've been doing to block it from my sites.

What is referral spam?

It's traffic from bots and spiders created by unscrupulous websites. It visits your site like any annoying neighbour who'll never leave you alone. Constantly knocking on the door until you answer. And referral spam does it over and over again. Thousands of times until you finally search online for the blasted name of the referral source and you're redirected to some shitty site selling some shitty product. That's their game to bring in traffic by frustrating Google Analytics users on an international scale.

How do you know if you have referral spam?

Experienced a massive spike in traffic recently? Hopefully it's down to some effective marketing, but if there's no apparent reason for it, check your traffic sources in Google Analytics. You can do this by logging into Google Analytics and on the left hand side navigate to:

Acquisition > All Traffic > Source Medium

You'll then see a list of your referral sources and if there's websites in there that look dodgy then they probably are. So far, I've clocked over 30 different referral sites.

If you're unsure if a site is spammy then just Google the name of the site followed by the word 'spam' and you'll probably see other people having the same problem. 

Why it's so rubbish for businesses

Simply put, if you use Google Analytics regularly you'll be aware of what's going on. That total traffic figure isn't genuine. But there are plenty of other people in most businesses who also have access to the account - and more often than not, they're not aware. So, for any form of reporting there going to be seeing figures which artificially inflates your overall 'success' online.

With some websites I've seen some accounts report no more than a few visits from spam sites. Others have been making up over 50% of their total figures. That's thousands of visits. Google appears to the aware of the problem, but solutions aren't yet forthcoming. 

So how to block referral spam

Step 1: Start blocking bots

  • In Google Analytics, go to the Admin section
  • Click 'View Settings' in the far right column
  • Scroll down the page so a section marked 'bot filtering'
  • Click the box ' Exclude all hits from known bots or spiders'

Based on the swarm of spammy sites hitting websites, it doesn't seem to help that much. But it's better to have it ticked than un-ticked.

Step 2: Set up Filtering

Setting up filters in Google Analytics allows the software to filter out traffic from any domain name, IP of if needed country that you choose. I set this up for each new spammy referral site that comes about. 

To do this;

  • In Google Analytics go to 'Admin'
  • Click on 'Filters' in the far right column
  • Click 'New Filter' (the big red button)
  • On the new page add a Filter Name
  • Click 'Custom' on the filter type.
  • Choose 'Referral' from the 'Select Field' dropdown
  • Under 'Filter Pattern' Add the domain name of the spammy referral site you want to filter out.
  • Click Save.

Repeat this process for however many referral sites you want to block out. 

Now the problem with this is that applying a filter will only stop new visits being recorded from the time you press save. It doesn't do anything for the visits which have already been recorded. 

So, to see a more accurate traffic figure we're going to need to set up and apply a segment. 

STEP 3: Setting up and applying a Spammy Referral Traffic Segment

  • Head to the 'Visit Overview' screen (the main screen you'll probably see once you log into with your traffic in it)
  • Click 'Add Segment' (in the top right)
  • Click 'New Segment' big red button
  • Give you segment a name in the 'Segment Name' field. Something like 'spammy referral traffic' will do. 
  • Go down to 'Conditions' from the list of options on the left hand side.
  • On this screen you'll see three options: Filter - Sessions - Include. 
  • Change the word 'Include' to 'Exclude'
  • Beneath it they'll be a button saying 'Ad Group'. 
  • Change this to 'Source'
  • Don't change the word 'Contains'
  • Add your domain into the box to the right of this.
  • If this is your only website you want to remove from your data. Click Save.
  • If you want to add more than one website. Click the 'OR' button and repeat the process.
  • Then click save

Then when it comes to measuring your traffic, head back to the 'Add Segment' button and choose the segment you've just set up. By applying this will then give you an accurate, non-spammy reading of your total traffic. However, as more and more referral sites seem to emerge your filters and segments will need to updated accordingly.

In the meantime hopefully Google will be able to come up with a more full proof way to block this sort of traffic.