Block in Google Analytics (Referral Spam)

In this article we will explain what is and how to block this Referral Spam from messing up your Google Analytics.

If you’ve happened to encounter referral spam – you have come to the right place. On this page we will explain to you what exactly it is you’re dealing with, how it operates and what your best options of protecting your website from this problem are. We have also attached a guide, which you will find below the following article, that aims to help you block and stop it from further messing up your stats. The guide includes step-by-step instructions, which when followed closely should have the issue solved in no time. However, in case of any trouble or you would just like to share your feedback, please use the comment section below the guide.

What is and how does it operate?

You have become targeted by one of any website owner’s worst nightmare: referral spam, also known as ghost spam, which is not to be confused with the classic referral spam (more about that in a little bit). While this form of spamming does not necessarily pose threat to either you or your website, it is a rather annoying and even obtrusive element that can often lead to misinformation regarding your website’s statistics and all that may come as a consequence of that. More so, in fact, the longer it remains a factor on your website. It functions in a fairly simple, yet ingenious way. The spammers target, say, your website and a few thousand others and create fake visits that appear in your Google Analytics stats. The visits can be several and will usually have a very high bounce rate, mostly with no time spent on the page at all. This is done with goal only: to provoke your curiosity and check this other website that has been visiting yours so often. That’s all. This creates traffic for the other site, because as opposed to their ‘visits’, yours are actually real. This will in turn boost their rating and will make them appear higher in the Google search results. And picture even a small percentage of the thousands of people whose sites were targeted paying the spammers a virtual visit – that’s already a pretty solid number.

Now, this is not be mistaken with the way ghost spam’s predecessor, the classic referral spam worked. In that case, the spammers would actually use bots and crawlers to visit your website, thus leaving a mark on your visitation stats. These actions were quickly countered by Google and this form of spam was quickly hunted down to near extinction. As you can see, its successor is far simpler and more difficult to battle.

Google Analytics and the Referral Exclusion List

It’s important to understand that does not affect your actual traffic data, your ranking or your page’s popularity in any way. All it does is mess with your statistics and thus provides a rather unrealistic picture to you, the owner. And the longer is allowed to continue with this, the more twisted that picture will become and you will eventually lose perspective over your actual, real stats. That’s why it is important to block its activity as soon as you can, but don’t make the mistake of trying to do that through the Referral Exclusion List. This is a common course of action for many affected users, which inevitably leads them to regretting it. The Referral Exclusion List is a great tool, but unfortunately not for combating ghost spam. Using it will only confuse GA and will lead to even messier stats and those ‘ghost’ visits will end up being seen as real traffic, which you certainly don’t want.

To fix your current issue with, as already mentioned, you have the guide below at your disposal. But it’s no less of a priority to avoid referral spammers from now on. Though there isn’t a way to permanently exclude the possibility of being affected by spam, we can offer you a general tip to lessen your chances of future encounters like this one. Our advice is to consider upgrading to a better hosting service. More often than not, more expensive hosting will offer better spam-filtering tools and will in this way provide better protection against referral spam. You should especially look into this, if your website has to do with affiliate marketing, which, as it is basically a network of many different websites, provides greater possibilities for spammers to target you.

How to Block 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!

How to 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!

One Reply to “Block in Google Analytics (Referral Spam)”

Leave a Reply

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