Referral Spam

How to stop /referral in Google Analytics

This page was created to help you block the /referral in Google Analytics.

The /referral is what is commonly known as referral spam. This is a virtual phenomenon that has been causing website owners a headache for quite some time now. We have developed the below guide to help you remove this nuisance from your life and have also compiled some tips to make sure you aren’t targeted as easily. We say this because at this point in time we, the people located on this side of the spam fence, are still struggling to keep up with the spammers and shield ourselves from their tactics. Google was successful in tackling the older version of referral spam, called classic referral spam, and controlling its presence on the web today. Classic referral spam operates by the means of bots and crawlers that visit your website, making you think that you’ve been visited by actual people or websites. As you understand, those visits aren’t real and only create an impression of traffic. This type of spamming has spawned a newer version of itself, which is known as ghost spam. It has taken a step further and has skipped resorting to bots. Instead, the spammers simply go ahead and manipulate the data in Google Analytics, putting in false information of visits by the spamming website.

So, in other words, you don’t get any visits whatsoever, but see them in your statistics. The goal of all this data manipulation and going through this load of trouble is simple: to generate more traffic for the spammers. It boils down to sparking your interest and prompting you to check out this mysterious website that keeps visiting yours. That way you will have created a genuine visit for them. Doesn’t sound like much, right? All this work for one lousy visit? Consider this, though: spammers typically target up hundreds of thousands of websites worldwide, all with the same idea. Imagine even a fraction of those website clicking back on them – that forms a pretty large amount of visits and some solid traffic. So, following the many visits, their popularity automatically rises and boosts their ranking.

So what? It’s not like they’re stealing my traffic, why should I care?

If your website and its audience are of any interest to you at all, you should care. It’s true that this practice doesn’t directly harm you in any way – it doesn’t change your ranking, doesn’t affect your actual traffic count and it won’t reflect externally on your website. But, it does mess with your stats, and the longer you delay and abstain from acting on this instance of data manipulation, the worse it will get. This means that you will no longer have a clear picture of the type of audience that is visiting your site, you won’t have a good idea of the exact amount of visits you get and you will end up all in all with a very distorted image of your website’s popularity. Therefore, we highly recommend you don’t hesitate and follow the below steps to rid yourself of and prevent it from further meddling with your stats.

What NOT to do

Because this solution has been suggested fairly often and because it is a bad solution, we would like to describe it here, so you don’t make the same mistake many have made before you. There is a certain tool called the Referral Exclusion List, which is not meant to deal with ghost spammers, but is applied for this purpose anyway and leads to utter chaos. What happens when you enter the spammer website in this tool, is that Google Analytics try to trace back the visits from it to their source. This fails miserably, because – as explained above – these visits never happened in the first place. As a result, the visits are then regarded as real ones and are seen as real traffic, which contributes even more to the alteration of your stats and, this time, even affects more than just those.

What TO do

As the only functional method we can rely on to keep spammers like away are spam filters, it would make sense that we invest in those. And the spam filters on your website are determined by the hosting you’re using, so if you are currently using some cheap hosting company, we recommend you upgrade to something a bit more expensive. You’ll pay a little more, but you will be minimizing your exposure to referral spam in the future.

Block /referral spam

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