How to block Referral Spam in Google Analytics

This page was created with the intention to help webmasters block the referral spam in Google Analytics.

Google has analytics tools that help with website statistics of any kind. They are reliable and useful – with an intuitive interface and powerful tracking tools. They offer you a myriad of options to know exactly what is going on in your website. Unfortunately, everything isn’t all fine and dandy in the world of the internet. Various malicious individuals such as Black Hat hackers exist that aim to exploit you – the average user – into falling for their tricks. Behind their actions, one could find that their real intention is most often monetary gain of any sort. All of their actions could be traced back to this simple truth. Understanding these intentions and the actions that supplement them is the key to fighting them. Armed with knowledge, you have the chance to show your spammers who’s boss. – your enemy of the day – is nothing special. Its just yet another instance of referral spam – the topic of the day. When talking about this issue, generally everything boils down to the same principles employed by these spammers. While there are thousands of differently named referral spams, they generally do the exact same things. In other words, there is always a pattern, so it does not matter if we talk about or referral spam in general, because it is the exact same thing. With that said, we have a guide at the bottom of this article that shows you a step by step process to stop the spam. Do not jump to it immediately before reading the following paragraphs. Knowledge is your most vital weapon – do not neglect it.

How is best described as? What does it do? – an example of referral spam – is a form of spamdexing (spamming aimed at search engines). It involves making repeating web site requests using a referral URL to the targeted site – the place of their advertisement. As a result, your access logs and reports will contain this URL of the spammer, which links back to their own website. Firstly, we must immediately get it out of the way that you should not investigate this link – or any for that matter – because that will only achieve what the spammers are hoping for. They want to make you curious and trick into looking at their site. Expect a lot of social engineering at work if you do end up on the other end. Things such as services or products may be displayed in front of you. No matter how tempting their offers may be, always keep in mind that they are fake.

As a web admin, chances are that you regularly check your reports and logs – maybe even on a daily basis. Those tools help you understand what your audience is and where they come from. After all, referrals are used for this exact purpose – tracking the source of visitations. This information helps you determine where you need to focus your attention to gain even more. Are they being a linked to your site from a particular place you advertised to? Then focus your ad campaign there. The usefulness of this feature is whats exploited the most referral spammers. As it was mentioned before, in the referrals, once could switch the name to a search term or a link. They use the latter. Your curiosity is what they are counting on. If you keep these facts in mind, you will identify referral spam easier and as a result present yourself as a more difficult victim by ignoring the links.

What types of referral spam are there? Can they harm my site?

Lets first quickly dismiss the following myth – referral spam does not actually harm your site’s ranking. The only pollute your statistics – which is enough of a reason to take action against it. Its also important to know that, for the most part, referral spam falls under two categories. Crawler Referral Spam uses bots (named crawlers; from which the name comes from) to access your site in the same manner as Google’s crawlers. This can be blocked in the .htaccess file, but is less common. The more common version is Ghost Spam. This attacks the Google Analytics servers directly and completely bypasses your site. This is where blocking through the .htaccess file does absolutely nothing. It may seem to work on first glance, but this is a mere illusion. The best way to block is to follow our guide outlined below. Best of luck!

Get the referral spam removed

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!

2 Replies to “How to block Referral Spam in Google Analytics”

Leave a Reply

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