Referral Spam

Block Referral Spam in Google Analytics

What is Referral Spam? How to block from showing in your Google Analytics? Learn this and more with the help of our guide!

In this article, we will introduce you to the referral spam technique used by many hackers and online crooks to sell back-links and google rating. For people who heavily rely on their websites, referral spam can be a real pain in the back, because it prevents them from accurately estimating their real traffic. is a newly released referral spam campaign that has recently been spotted across the glove. Since (so far) google has been powerless to successfully block Ghost spam we decided to create this article so our readers are able to block themselves. Here, you will learn how Ghost Spam works, why it is a problem and what you can do in order to prevent your website from getting spammed in future. Also, there is a guide beneath the article in which you can learn how to block it.

What is

The intrusive software is basically used to generate fake views to your website. The idea of this is that the owner of the targeted site would sometimes trace back the URL of the spammer, thus visiting their site and generating them views in return. While the referral spam does not actually affect your Google Analytics stats, it prevents you from accurately estimating the actual amount of traffic that your site gets. If you care about the accuracy of your statistics will definitely be a problem. Fortunately, it will not hinder the performance of your site in any other way.

Ghost spam

Earlier versions of referral spam software also known as Crawler Referral used spambots to generate the fake views to people’s websites. However, at some point Google managed to deal with this issue and spambot visits were no longer displayed to the user. This rendered the regular referral spam ineffective and hackers had to come up with a new method.

In 2014 the Ghost spam was invented. Instead of using spambots, this new type of spam directly modified your Analytics stats so that it appears you have more visits than you actually do. Since those are not real visits, Google has nothing to filter and block from appearing and is thus unable to stop the Ghost spam. Attempts at resolving this issue are being made but so far this type of spam seems to be working and is hugely popular among hackers and online crooks. is also a Ghost type of spam.

Does it harm your website?

As we already said, even though referral spam is annoying and can become a real frustration, it is generally does not pose a direct threat to your website. However, it is important to remember not to trace URL’s that you know are coming from a referral spam. Also, despite it not being inherently harmful, can turn into a considerable issue the longer it keeps on spamming. There might come a point where you have no idea whatsoever what is the real amount of traffic your site gets. This can be particularly problematic if you use the site to make a living. Therefore, we advise you to go straight to our guide right after you finish reading the article.

Guidelines for future

After you have blocked from further spamming your site, you must make sure that no more Ghost spam bothers you. There are several important tips and guidelines that you need to follow in order to do that.

First and foremost, do not use the google exclusion tool. Before Ghost spam was invented, this tool did its job just fine. As soon as you noticed that a specific URL is coming from a referral spam, you’d add it to the list and its visits towards your site would get blocked. However, the effect is actually reverted when you try using this on Ghost spam URL’s. Because they do not actually generate any real visits, as soon as you add the URL to the exclusion list, Google would run a check and when it is determined that no actual spam visits are coming from it, it would automatically be considered as legit. This would effectively serve as a free pass for the spam to keep on changing your analytics stats without being targeted by Google. Since almost all referral spam today is of the Ghost type, we strongly recommend that you DO NOT use the exclusion list.

Another important tip for future use is to get a high-quality filtering tool for your site. This can heavily decrease the chance of anything messing with your traffic stats. Commonly, the filtration tool really depends on your hosting company. Therefore, it’s essential that you choose a reliable company with high standards. Surely, this would usually cost a bit more, but when it comes to managing a website, you should always ensure that you are getting as much security as you can afford. Therefore, do not save resources from providing your site with high-quality protection and hosting.

Block Referral Spam in Google Analytics

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!

Leave a Comment