Referral Spam

Block Referral Spam in Google Analytics

The referral spam in Google Analytics is a new breed of problem. This page is dedicated to eradicating it from your GA statistics.

Referral spam is one of the most common problems website owners across the globe are faced with on a daily basis. is among the ranks of the many, many cases of referral spam that exist today and this guide will show you how to remove it. We have included easy step by step instructions, which will walk you through the process, but we’ve also put together some of the most important things you need to know about this particular issue.

First of all, it’s important to differentiate classic referral spam from something known as ghost spam. In the case of the former, spammers use bots and crawlers to visit your website, typically multiple times and with no session time. The idea is to make you curious as to this mysterious visitor that doesn’t even spend a second on your site, yet keeps coming back. The scenario you are expected to follow is: notice these visits, raise an eyebrow and click back on this website visitor. You’ll then probably notice that the website is of no interest to you and most likely doesn’t even have anything to with your site, but you will have already generated a hit and that’s all that matters. They are quite simply only after your visit. And the best part is that this kind of spam will target numerous victims all over the world, so as a result there will be quite the substantial amount of traffic created.

Luckily for us, though, Google successfully managed to put a stop to the classic referral spam, keeping it to a bare minimum. That is why ghost spam came to be and the difference between it and its predecessor is the ingenious fact that it skips the whole bot/crawler thing altogether. As opposed to that tactic, it goes straight to your stats in Google Analytics and changes the information there, so it looks like you’ve been visited by the spamming website. Pretty smart, huh? Unfortunately, not a good thing though. The horror of having as a constant presence is that over time it will mess up your statistics so bad that you will hardly be able to recognize them. It will ultimately destroy your perspective on your audience and views, and all the necessary information you absolutely must have in order to grow and prosper. This is why removing it as soon as possible is essential and will save you a huge load of troubles in the future, because the longer it remains – the more inaccurate your stats will become.

However, you should be careful not to create even bigger problems in your desire to fix the existing ones. You might find various recommendations online, telling you to apply the Referral Exclusion List. It’s a great tool and useful one, but it’s not meant to deal with and others like it. That’s not what it was created for. And what happens when you mix two things that are incompatible? Disaster. And this is exactly what you will be looking at, if you put the referral spammers in the Referral Exclusion List. GA will automatically head over to follow up on the visits you’ve reported, but will fail to trace them back because there were no visits. What happens then is GA shrugs its shoulders and counts those visits as traffic, as no spam was recognized. So on top of still having circling above your head, wrecking your precious stats, you’ll also have to pay for the visits from it that never actually happen. This is one of the cases when no action is better than this action.

How to protect yourself in the future

As far as shielding yourself from potential nastiness goes, there’s really no 100% way to be safe from referral spam. You can maximize your security, though, by investing in better hosting for your website. Better hosting means better spam filters, which means less chance of being targeted. This should be your ultimate priority especially if you are engaged in affiliate marketing, as this makes you an easy catch for spammers. They can sneak up on you through some weak link in the network of websites also involved in the marketing campaign, so be sure to keep this mind.

Block Referral Spam

STEP 1: In your Analytics account go to Admin —> All Filters.

pic 1(1)

STEP 2: Next, click New Filter and add in the Filter Name value.

STEP 3. Select the Custom Filter Type.  In the Filter Field —> Campaign Source. In the Filter Pattern text box, add and click the Save button at the bottom of the webpage.

Pic 2(1)

 Blocking referrer spam through .htaccess

If you know how to access your .htaccess file, you just need to input the following code in there:

RewriteCond %{HTTP_REFERER} [NC,OR]
RewriteCond %{HTTP_REFERER}
RewriteRule .* - [F]

If you don’t know how to access it, do the following:

Login to your cPanel account —> File Manager —> click the check-box “Document Root for—> your website. A side note: click on “Show hidden Files” and then Go. Find the .htacess file, right click it and choose Code Edit. Input the code I gave you and Save Changes. 

Did we help you? A thank you in the comments goes a long way to warm our hearts!

Leave a Comment