Referral Spam

Block /Referral Spam in Google Analytics

This page was created to help you block the /referral spam in Google Analytics.  Practically the only reason you are here is because you saw something quite unusual in your Google Analytics function, something that apparently seems like the activity of live humans, but in reality is not. If you’ve seen in your statistics the /referral, then you’ve become the victim of “referral spam” – an unsavory new way competitors attempt to put a dent in your efforts.

PLEASE, read this! The first order of business is to help you actually understand what this is, how it works, and most importantly – why was it created. Why is this important, you might ask? The reason is that if you understand how the /referral spam works, you will quickly realize that the solutions and methodology apply to all referral spam you are prone to encounter in the future. This is something created by competitors and black-hat SEO practitioners and you can bet they won’t stop doing it. 

So, first things first: the referral spam was created as a simple tool to manipulate Google Analytics statistics. It’s just a bot hovering around, connecting to websites – either randomly or because someone sicced it towards you. The one modus operandi you can be absolutely sure of, is that the /referral spam and any other kind of referral spam will connect and leave with only a few seconds per session. This is the main point: that each session will never last more than five seconds. The worst thing however is that there are more ways to spam than just referral – referrals are easy to see and with the guide below you can easily block them.

If you want some insights how you can identify the other types of spam, consider :

  • Do you have an excessive amount of traffic (again with a very short time per page, possibly even 0.00 seconds) coming from the same exact geo-location? Not country, mind you, a specific city or location.
  • Another possibility is an internet provider. This is a lot trickier to spot, because the sessions here are not the same duration, they always range between 1-10 seconds, so it’s harder to detect them. This is a chameleon kind of referral spam.

Again: these are just bots, but they are actually harmful. I will outline why next:

  1. Referral spam like can only affect your data in Google Analytics. It’s just a pest that makes things harder for you to understand and at worst it can confuse you greatly, making any campaign (advertising, for example) decisions be made for the wrong reasons.
  2. The other kind of spam is actually harmful: extreme amounts of it are called a DDoS attack. Most of the time this doesn’t occur, but small amounts of it always exist. In essence, it creates a bot that goes through proxies that just connects and disconnects from you all the time, plummeting your average duration per page. We, for example have had exactly that kind of problem in the past. The result was that one of our pages fell from the first spot on Google, to number 10. Really.

One thing I can say for certain is that, although the /referral spam is far from being a real problem, it should not be ignored. Obviously, you are on this page, so you’ve definitely received the message. Thank you for reading this piece and I hope the information will help you in the future.

Remove 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!

1 Comment

Leave a Comment