How To Block Referral Spam In Google Analytics

Today’s article is about the referral spammer in google analytics. A high number of reports have been sent to us concerning rank checker online. If you also seeing it in your google analytics make sure to block it with our step by step guide. This spammer was first reported to be operational on 15.03.2016.

What is and why does it show in my Google Analytics is a recent addition to the referral ghost spam scene. Websites that have been targeted by will register an increased number of ghost visits that have a 100% bounce rate and/or very short (or none) session time. This is not a new phenomenon – referral spam has existed for several years now and is growing in popularity. In this article we’ll explain the dangers associated with being the victim of this referral spam, as well as the possible solutions you can implement to fix the problem. referral spam will not negatively affect the performance of your site

Sites marked by this referral spam will not get adversely ranked in search engines and this has been officially confirmed by Google officials. Ghost visits do not actually load your pages, so they don’t take any traffic either. The main way referral spam like may hinder you is by polluting the accuracy of your Google Analytics. This problem will exacerbate over time, so it is recommended that you take action against the referral spammer immediately. But before you do that here are some basic facts you need to learn in order to combat it successfully.

There is a difference between classical referral spam and the more recent ghost spam technique. Since Google has been clamping hard on this type of behavior hackers switched their methods by introducing the ghost spam technique. Referral ghost spammers (like do not actually visit the sites they target with bots or crawlers, instead they will directly send that data into your site’s Google Analytics via a measurement protocol. There are some speculations about how exactly this is done, some people believe that the hackers will target random websites by creating random strings for IDs. Another possibility is that crawler bots are used to records IDs for future use. Whatever method exactly is being used apparently it works for them.

The goal here is to make you curious and bait you into opening the spammer’s page address. From there you are usually redirected to the page that is currently promoted by the referral spammer – you create a link and a session for that page.

It goes without saying that this practice is illegal, yet there are plenty of shady websites that make excellent practice out of it. The only thing we can do is wait for even more sophisticated prevention tools to be invented by Google programmers. In the mean time you can fix the problem yourself by creating some filtration lists.

Using the Referral Exclusion List is a bad idea

People familiar with this function may already have some ideas on how to use it to fix the problem – well the short answer is no, it won’t work. In fact this may even may it worse!

When you use this function Google will try to find the originator for the traffic, fail and report it as a direct visit as a consequence. GA will no longer register the referral spam as such, but your direct visit metric will skyrocket to highly inflated levels.

The proper way to block for good is to set up a filter, as well as restrict its .htaccess. You’ll find the instructions on how set up those in the guide below. Please note that for best result it is recommended that you do both of these.

Remove referral spam

STEP 1: In your Analytics account go to Admin —> All Filters.

How To Block Referral Spam In Google Analytics

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.

How To Block Referral Spam In Google Analytics

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!


About the author


Nathan Bookshire


Leave a Comment