loading gif

How to block spam referral traffic in your Google Analytics (A dramatic reenactment)

“You'll recognise them easily, they often have really obscure names, or keywords related to SEO, buttons or traffic, or they just generally wont make sense in context to your usual audience.”

Anyone who owns a Google Analytics account will know the pain inflicted by spam referrals on your analytics data. These pesky referrals skew your data, preventing you from being able to accurately read and report on your results. You'll recognise them easily, they often have really obscure names, or keywords related to SEO, buttons or traffic, or they just generally wont make sense in context to your usual audience.

How to block spam referral traffic in your Google Analytics


So we've put together a step-by-step guide to setting up filters to remove spam from your Google Analytics.

Step 1: Create a new view for your filters

It's important that when you're making any drastic changes to your Google Analytics to do so using a new view, so go to your Admin panel (found on the right of the top menu).

How to block spam referral traffic in your Google Analytics

Choose the "View" dropdown menu on the right hand side and select "Create new view". Name it (We usually name ours "Exclude Referral Spam" as seen below) and select a timezone and you'll be ready to filter your data in no time.

How to block spam referral traffic in your Google Analytics

You'll now see the same admin menu you were viewing before, however this will be under your Exclude Referral Spam view. There are two important menu items to be aware of here.

How to block spam referral traffic in your Google Analytics

2. Select bot filtering

Under the "View" menu, select "View Settings" item and find the "Bot Filtering" check box. Check it. This will allow Google to help you filter out all the known bots and spiders they can from your analytics.

How to block spam referral traffic in your Google Analytics

Nice one, lets move on:

3. Add your filters

Go back to your "View" menu under the Admin Panel, and this time select the "Filters" item and click the "+ New Filter" button.

How to block spam referral traffic in your Google Analytics

Now you're ready to add a filter to your view. This is how you do it:

  1. Select "Create New Filter"
  2. Choose "Custom" filter name.
  3. Select your filter to "Exclude" data
  4. Assign your Filter Field as "Campaign Source"
  5. Add your filter pattern with the addresses you want to remove.

This is what a standard campaign source filter pattern looks like:

guardlink\.|social-buttons\.|Get-Free-Traffic-Now\.|event-tracking

The dots and dashes are called "expressions" and you can read more about what these mean through the Google Analytics Help Centre. The most important thing to remember is that you should never leave a \.| on the end, as the | translates to "and", so having nothing after it actually translates to "everything" and will wipe out all your data from when you set up the filter to when you realise what you've done (can you tell I learnt this from personal experience?).

Make sure you pick key words, rather than a whole URL, that will target the referrals you want to exclude. For example, best-seo-solution.com and best-seo-offer.com can both be excluded by including best-seo\.| in your pattern.

How to block spam referral traffic in your Google Analytics

Click save and you're done! You've created a filter! Those pesky spam referrers are gone!

Step 4: Celebrate

You've earned it, you go girl!

How to block spam referral traffic in your Google Analytics

Step 5: Take a fabulous beach stroll

Reward your amazing efforts with some fresh air and a fashionable kaftan.

How to block spam referral traffic in your Google Analytics

Step 6: Check in on your filters a week later to see how well they're doing and bask in your glory and majesty

But hold on, not everything is as you left it...

Oh, did you think it would be that easy? Sorry, I forgot to mention...

How to block spam referral traffic in your Google Analytics

Step 7: Realise that about 5 new spam referrals have come out of the woodworks, and they're terrible


What is this sorcery???

Step 8: Have a cry

It's okay to feel discouraged at this point.

How to block spam referral traffic in your Google Analytics

Step 9: Like, a really big cry.

Just get it out, babe, I feel you.

How to block spam referral traffic in your Google Analytics

Step 10: Pull yourself together

Alright, this is frustrating, but you've gotta find a solution for it, you can't just be updating filters every day/week right?

How to block spam referral traffic in your Google Analytics

Step 11: Do some more research

Google what other people are doing, find out that everyone is basically saying the same thing as this blog.

Step 12: Throw out your computer

It's basically useless now, right?

How to block spam referral traffic in your Google Analytics

Step 13: Vent your frustrations

Damn you Google Analytics! Why don't you just work????

How to block spam referral traffic in your Google Analytics

Step 14: Question your very existence

What is the point of life? Why am I on this earth? What difference will this data even make when I'm gone?

How to block spam referral traffic in your Google Analytics

Step 15: Give up

Let's face it, you tried, but keeping this up is just not going to happen.

How to block spam referral traffic in your Google Analytics

Step 16: Watch your Google Analytics burn down around you.

How to block spam referral traffic in your Google Analytics

Totally fine.

Indietech blog article author - Digital Marketing and Web Design insights
02-Jul-2015
Noted by Penny Wilson

Marketing & design inspiration
direct to your inbox