Stop referral spam in Google Analytics

This page was created to help you stop the referral spam in Google Analytics. is what is known as a referral spammer – a type of web spam. What it does for the most part is meddle with your Google Analytics reports by involving false data in them. For example, when checking the reports for your website, you might discover some obscure amount of visitations from another website – this information is typically fake. Its goal – or, rather, the goal of the spammers behind it – is to lure you into clicking on this strange website, that’s been visiting yours recently. This way they generate traffic for their website. Imagine, say, they’ve manipulated several hundred thousands of websites into thinking they’ve been visited by this site in question. Even if only a fraction of those sites return the visit – that is already a substantial amount of traffic and boosts them up in the Google search results.

What you need to know about the referral spam

The above phenomenon of getting large amounts of visits with practically 100% bounce rate and little to no session time is widely known as ghost spam. ‘Ghost’ because the visits aren’t actually real. It’s a pretty common nuisance these days and unfortunately it’s only becoming more and more popular. What we should start with saying, however, is that the referral spam will not harm you or your websites in any way. All it will do is mess up your statistics, which just happens to be important for you to keep track of what’s going on with your website. The ghost visits do not register as traffic, meaning the pages aren’t actually loaded. Once again – this information is only sent to the Google Analytics tool to get your attention. Keep in mind, though, that the longer this issue remains unaddressed – in other words, the longer your website is targeted, the more inaccurate your statistics will become. Therefore, it is best that you follow the steps in this guide to deal with the problem accordingly and prevent it from causing further damage to your stats.

This web spam method has become the alternative to the previously more commonly used classical referral spam. In the latter case, websites were actually targeted by bots and crawlers in order to make the ‘visits’ known to you. Luckily, Google has managed to almost completely eradicate this form of spamming, hence the appearance of ghost spam. But we trust in the masterminds at Google and hope that they will come up with a way to effectively combat this occurrence as well.

The Referral Exclusion List and why not to use it

Some people suggest that a good remedy against cases of referral spam is the tool intended for this purpose, known as the Referral Exclusion List. Yes, it sounds appropriate and seems like the logical way to proceed once faced with this issue, but it isn’t. As a matter of fact, you might just be adding more oil to your steadily burning fire of troubles.

Once you’ve added the referral in question to the exclusion list, Google Analytics try to connect the return visit to the original visit and fail. So, as a result, you’ll end up having the spam visits registered as genuine traffic. Which will still leave your stats just as messed up, if not worse. To put it simply: avoid using the Referral Exclusion List tool. It was meant for an entirely different purpose and is not meant to be used as a tool against referral spam.

Drawbacks of the referral spam and possible solutions to this issue

Just to sum it all up, let’s be clear on the reasons why spammers would target your or anyone else’s website.

Firstly, it’s because they want to promote their website and their aim is to get you to visit it or search for it in Google. Secondly, the spammers would really like to get bumped up in the Google search results with the help of backlinks. This is achieved by logging requests into your website’s access log. Afterwards, this will be seen by Google’s indexing bots and it will register as a backlink to the spam site in question.

Below we will show you two ways of ridding yourself from the referral spam, one of which is setting up a good filter and the other is restricting the .htaccess. For optimal results, we suggest using both methods.

Remove referral spam

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

pic 1(1)

STEP 2: Next, click New Filter and add the referral spam 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 the referral spam and click the Save button at the bottom of the webpage.

Pic 2(1)

 Blocking the referral spam 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} the referral spam [NC,OR]
RewriteCond %{HTTP_REFERER} the referral spam
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