Referral Spam

Block Referral Spam in Google Analytics (Feb. 2019 Update) is a form of referral spam and is a plague well known to a lot of website owners. If you’re on this page, you have probably been targeted and know why we’re calling it that. And though it’s quite the nuisance, don’t panic – it will not affect you traffic count, your website’s popularity or your ranking. No one except you will even know there’s an issue present, if that knowledge offers you any comfort. However, it will noticeably alter your statistics and the longer you delay taking action against – the messier those stats will become. Therefore, we’ve compiled the below guide to help you block this problem. Before skipping to the instructions, read on to learn the principles of how referral spam operates and how to protect yourself from it in the future.

What is

There are two distinguishable types of referral spam: the classic referral spam and ghost spam. In the case of the former, hackers would employ bots and crawlers to come visit your website and create the impression that you were visited by a given website (that of the spammers). The goal would be to lure you into clicking back on this visitor (because there would typically be several visits made by it). This way you would be creating traffic for the spammers’ site. Easy. And you would be one of the possibly hundreds of thousands of victims targeted by the same referral spam, so however little the percentage of ‘click-backs’ – it would still form a substantial amount of traffic; perhaps enough to give them a pretty decent boost in their ranking even.

But, classic referral spam has more or less been eliminated by the specialists at Google, which is why the cyber outlaws quickly came up with a better alternative – ghost spam. Instead of using bots, it just meddles with your stats in Google Analytics and you are basically left with visits only ‘on paper’. Only you don’t know that; to you it’s just some strange visits by the same website with virtually zero session time. So, like in the instance of classic referral spam, you click to see what site this was. And it all follows the same scenario described above.

Why exactly should this alarm me again?

Well, we mentioned that won’t affect you ranking, your traffic count or any of the important stuff that can cost you your money and reputation. But in the long run… maybe it will end up doing just that. Just think: if you are repeatedly provided with inaccurate information from Google Analytics, which over time will only further twist and distort that data, how will you keep track of what’s really going on with your website? You will gradually lose any and all perspective as to your audience and that way you won’t be able to adequately determine what kind of content you should be posting, or when that content should be posted, or [insert relevant statement to your site]. So in the end this could result in you losing your target audience, which will then result in loss of money (if applicable) and eventual decrease in exposure and popularity. When you look at it that way, referral spam is a pretty big deal.

NOTE: It’s become a pretty widespread practice of users relying on a tool called the Referral Exclusion List to battle referral spam. This is a big mistake, simply because that’s not what the tool was created for. Furthermore, by using it not only will you not fix this, but you’ll end up burying yourself in an even deeper pile of dung.

So how do I prevent this?

Easy prey for referral spammers are businesses involved in extensive affiliate marketing campaigns that engage relatively large networks of websites. At some point they will be bound to find a loophole somewhere and cause trouble. And if you are using some cheap hosting – you’ve basically painted yourself red and wrapped Christmas lights around you, just to make sure those spammers don’t miss you. Thus, ideally you would upgrade to something a bit more reliable (=expensive). It’s not a huge investment, but it will go a long way, as the hosting company is who’s responsible for providing good protection for your site. They are the ones who set up the spam blocking mechanisms, and unless those are top-notch – you are going to run into problems.


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