Block Referral Spam in Google Analytics




In this article we’ll teach you how what is and how to block it from showing in Google Analytics.

If you are a owner or an admin of a website, then you should be no stranger to the term referral spam. It is a particular spam method used by hackers to promote the ranking of certain websites. In this article, we will explain in detail how this method works and why it is an issue for other admins. Our focus will be on one of the latest referral spam campaigns known under the name of It belongs to a particular type of referral spam strategy known as ghost spam. Here, you will learn how to block from interfering with the statistics of your web site, as well as hopefully learn a thing or two about referral spam in the process..

What is

Referral spam like basically create false visits to your website. The idea behind this is that once you see the URL of the new visitor, you might be tempted to trace it back to its source. This would in turn generate real visits to the hacker’s website, thus pushing it up the rating ladder.

The fake visits themselves do not change the stats of your site so you should not be worried about that. However, since they are not actual visits from real users, this messes up your Google Analytics stats and you are unable to accurately determine the actual amount of traffic and visits that your site is getting. For smaller websites that are not used for profit, this might not be a serious issue. However, if you use your website to make a living, you will need to be able to have reliable information concerning your site’s rating. Therefore, blocking the spam as soon as possible is important and we will show you how to do it in our guide that you can find beneath the article. – a ghost spam

When the referral spam scheme was first created, the method it used to generate artificial visits to user’s websites was via spambots. However, Google has found a way to deal with that issue. Currently, most spambot views are getting blocked, their views are not included in the Analytics stats and so the URL of the hacker is not displayed. However, as of 2014, a new type of referral spam has been invented that instead of using spambots, it directly changes your website stats tricking you into thinking that you have received actual visits. The real Google Analytics rating does not get changed by that but to you it will still appear that your site has been visited. As we mentioned earlier, too falls under the category of ghost spam. So far, Google has not been able to come up with an effective solution to this problem.

Important advice

Today, ghost spam such as is much more widely spread due to its efficiency. Referral spam that uses spambots is rare because dealing with it is much easier – all you need to do is add the spam program’s name to the google’s referral exclusion list and the spambots visits will be blocked from now on. However, when you are faced with ghost spam, it is exactly the opposite.

  •  Adding the ghost spam to the exclusion list would only further worsen the situation. Since ghost spam does not actually create visits to your website, once you add it to the exclusions list, Google would check it and once it does not detect any spam visits, the ghost spam will be marked as legit. From then, it is even more difficult to stop it from messing with your traffic stats. Therefore, if you are currently dealing with, we advise you to avoid using the referral exclusions list as a method to solve the problem. Instead, use our block guide down below which has been specialized for dealing with ghost spam.
  • Another very important thing you need to remember for future is to make sure that you have a good filtration for your site. This can really make the difference between being spammed by all sorts of frustrating spam and having your website’s traffic statistics neat and undisturbed.
  • Choosing a reliable hosting company is also essential especially if you intend to use your site as a source of income. If this is your case, we advise you to invest a bit more so that you can ensure the safety and security of your project. High-quality hosting companies provide a much greater protection for the user’s websites and the chances of getting referral spam with them are considerably lower.

How to Block in Google Anatytics

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 *