Block Google Analytics Spam

If your website has recently fallen victim to referral spam, we are here to offer you a helping hand with this annoying issue. First of all, let’s start off by saying that you have nothing to be worried about at this point, this is not some virus or malicious software attacking you. Below we will aim to give some insight as to how referral spam like this operates and what it’s really after. In addition to that, we will also provide you with a set of simple removal instructions that will help you block the spammers and prevent them from further messing with your stats. However, before you move on to the removal guide, do spend a few minutes to read through the following information, as it will shed some light on, as well as try to steer you away from a common devastating mistake that many users make.

How does referral spam work?

Once upon a time referral spam worked in a slightly different manner than what you’re more likely to come across today. We refer to that old school referral spam as classic referral spam. The point of all referral spam in general is to drive traffic to the spamming website. Classic referral spam would use bots and crawlers and send them out to thousands upon thousands of websites across the globe with the intention of being noticed. The bots and crawlers would generate numerous hits on the targeted sites, but with no session time and 100% bounce rate. To most website admins or owners this activity would stand out to say the least and a percentage of them are expected to click back on the spamming website and find out what’s going on. And at that point the cycle is complete: they will have visited the spamming website, having generated real traffic for it and subsequently having boosted its rating.

After a certain time Google was able to put a stop to this black hat SEO practice, but the spammers came back with a better version, for which there still isn’t an overall cure yet. Thus, ghost spam came to be in the form of variants like The reason it’s called that is because of the way it functions. Essentially, it does the same thing as its predecessor, only instead of using the bots and crawlers, ghost spam affects the Google Analytics statistics of the sites it targets. So, it doesn’t actually generate any traffic for them and affects nothing other than those stats. However, even despite that, it’s still really not much of a relief.

Yes, you might think that if it doesn’t impact your real traffic count or ranking, then, who cares? Well, if it’s important for you to keep up with websites real stats and be connected to its audience, then you do. Furthermore, the longer you allow to keep spamming you, the more it will keep distorting and twisting your stats, making them more and more inaccurate. So, in essence, the optimal thing to do would still be to block the spammers and prevent them from further messing up your stats. However, don’t make the mistake of resorting to the Referral Exclusion list for that purpose. No matter what you’ve read online, that is by far your worst option and one that will worsen your situation like you cannot imagine.

By entering in that list, you will basically be asking for GA to investigate your claim, which it will do by trying to trace back the reported visits. And it can’t do that, because there were never any visits to begin with, those were only fake impressions that exist only in your GA stats. So, GA will then mark those visits as real ones and now they will not only remain in your statistics, they will also become part of your actual traffic count as well. So you will end up also having to pay for them. Your best option is to use the below instructions and block the spammers. And once you have done that, you may want to consider switching to some better hosting service. Your hosting is what provides you with all the necessary spam filters and other means of protection, so if yours allowed a breach in the form of this spam, then it may not be the highest quality service out there.

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 *