How to 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.

In the event that you have been affected by referral spam – fear not, your troubles will soon be behind you. Referral spam is one of the most common issues website owners tend to face and believe us when we say that you are by far not the only one to be affected by Please take the time to read through the following few paragraphs to get better acquainted with the nature of this nuisance, before moving on to the removal guide below. The guide is written in step-by-step form and will walk you through the process of blocking the referral spammers, which will rid you of their influence. What it’s all about is a form of ghost spam – a subgroup of referral spam. This type is the successor of the oldest referral spam, nowadays known as classic referral spam. The difference between the two is small, but fundamental. In both cases the goal of the spammers is to attract traffic to their website and boost its rating and popularity. Again, in both cases this is achieved by tricking owners of other websites to visit theirs. Now here comes the difference: in the case of the older classic referral spam, the spammers would send bots and crawlers to the targeted websites, thus imitating traffic, however there would be literally no session time. This was intended to spark that website owner’s or manager’s curiosity and pay this visiting website a visit themselves, just to check it out. And with that the process will be complete: a hit for the spamming website will have been generated. Now, the classic referral spam, mainly thanks to the fact that it employed the use of bots, was quickly eradicated by Google’s specialists and you will have a pretty hard time finding its representatives today. However, this is where ghost spam appeared and it took a different approach to the same principle. Instead of sending crawlers, spam like would go directly to your Google Analytics stats and meddle with them, putting in data of fake visits that never happened. This way, the same effect is achieved: you think you’ve been getting actual hit and click back to investigate.

How harmful is this?

Depending on how you want to look at it, from not at all to absolutely devastating. Objectively, does not affect your actual traffic count and it will not harm your rating or the site’s popularity. It only has influence over your statistics. But if you are interesting in always having a fresh and realistic perspective on how well your site is doing, this will soon become an issue, as the fake visits will start changing the picture. As a result, the longer the spam issue remains unaddressed, the less your stats will have to do with reality. For this reason, you might want to block as soon as you’re finished reading this article. However, we would like to warn you against rash actions like entering the spammers in the Referral Exclusion list. Though the name of this tool includes the word ‘referral’, don’t be fooled into believing that it is meant to deal with referral spam. It’s not! Moreover, it will effectively make things a whole lot worse if you choose to go down that route.  

By using the referral exclusion list in the hopes of blocking the spammers, you will prompt Google Analytics to investigate the visits you’ve reported. As there were no real visits to begin with, this will lead GA to believe this was a false alarm and it will mark those visits as actual traffic. This will lead to your stats getting further messed up and on top of that, your actual traffic count will now be affected and you will be paying for traffic you don’t have. The best way to shield yourself from threats like these is by investing in good-quality hosting. Typically, the better the hosting – the better its anti-spam filters and other spam-blocking mechanisms. For those of you engaged in affiliate marketing networks, this should be of paramount importance, as these kinds of networks attract spam like magnets. It’s just too easy to find a weak link in the chain of affiliates, through which to start targeting the rest of the sites in the network.

Block in Google Analytics

Instruction #1: Enter your Analytics account.
After that load Admin and then – All Filters.

Instruction #2: After that, hit New Filter.
Next, add in the Filter Name value.

Instruction #3. Choose the Custom Filter Type. 
Once you see the Filter Field, go with Campaign Source.
Next, when you see the Filter Pattern text box, enter Confirm by clicking  the Save button you will see at the bottom.

How to block referrer spam using your .htaccess file

If you are aware of a way to access your .htaccess file, you will just have to write the  code below in there:


RewriteCond %{HTTP_REFERER} [NC,OR]

RewriteCond %{HTTP_REFERER}

RewriteRule .* – [F]

In case you are not aware of a way to access it, follow these instructions:

Access your cPanel account,
the go to File Manager.
After that you should mark the check-box ‘Document Root for’.
Then go to your webpage.
 Another important tip: choose ‘Show hidden Files’.
After that select Go. 
Look for the .htacess file.

Once you find it,  rightclick it.
From the options that appear, select Code Edit.
Enter the code above and Save Changes. 

Hopefully, we have been helpful! Tell us in the comment section. We will be glad to read what your opinion is!

Leave a Reply

Your email address will not be published. Required fields are marked *