Block /Referral in Google Analytics

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

You are most likely on this page because you’ve come face to face with /Referral. If so, then you have joined the battle against website owners’ arch enemy – referral spam. Granted, there can be worse things to happen to your website, but referral spam is one of those tricky, elusive SOB’s you simply don’t want around.

First – a little history. Once upon a time in a faraway land, hackers used to thrive on a thing known as classic referral spam to boost the ratings of affiliated websites. They would send out bots and crawlers to visit your website, tax your bandwidth with spam and prompt you to click back, thus creating traffic. But only for them; as the fake traffic generated by them was recognized as such by search engines. Then the knights in shining armor over at Google marched in and hunted down the classic referral spam, plunging it into near extinction. So it’s more of an endangered species today. However, the hackers worked day and night to create a better substitute for their loss, which is now known as ghost spam. Ghost spam doesn’t need the help of bots to do its dirty work; instead it takes care of everything on its own. It uses its dark sorcery to manipulate your data in Google Analytics, tricking you into believing that your website has been visited multiple times by the hackers’ website. While your site may be safe from bot spam, your Google Analytic statistics are not. But we’ll try to help!

Why all the hassle?

Well, as pointed out in the first part of the story, it’s to generate more traffic for the intruder site. The idea is to spark your curiosity and get you to want to check this mysterious visitor out for yourself. This will automatically generate actual traffic for it and thus boost its popularity. Keep in mind that it’s not just your one click that makes the difference. It’s the summation of clicks of the hundreds of thousands of websites that are usually targeted by referral spam like the /Referral. Even if only a fraction falls bait to this scheme, it’s still a pretty large number of visitors we’re looking at.

The problem

Though will not in any way affect your personal rating or where you appear when searched for in Google, it’s still not recommended to let it just hang around. As we mentioned, ghost spam meddles with your stats in Google Analytics and for anyone truly interested in keeping up with the reality of their website, this should definitely raise a bright red flag. By entering false data into your stats, you will sooner or later lose touch with the actual picture of your visitors, popularity and all that other stuff you need to be aware of in order to maintain your site.

Another problem tends to stem from people trying to fix this situation by applying the wrong means. We’re talking about the Referral Exclusion List. This is a great tool, but many are led to believe that it’s meant to battle ghost spam like the /Referral. Well, it’s not. And by entering the ghost spammers into that list, you will only end up making matters worse for yourself. The thing is, it will try and trace back the visits, but since there were no real visits to begin with, it will fail to recognize the spammers as such and proceed to mark those visits as traffic. This will further twist your statistics and put you in a place you don’t want to be in.

How to avoid this

Spam filters are the two key words in protecting yourself from referral spammers. Though the guide below will show how to remove, we’re sure you will agree that it would be easier to not get involved with referral spam in the first place. A good idea would be to invest in better hosting, as spam filters are a prominent part of the service hosting companies offer, and paying a little bit more for that service is almost guaranteed to provide you with better bang for your buck.

This should especially be true if you have extensive affiliate marketing campaigns, as those form loopholes for spammers and are a sure way to get targeted. The hosting company you use will be responsible for the spam blocking mechanisms, therefore pay close attention to the one you have at the moment and consider upgrading if you have reason to believe their methods aren’t good enough.

Block /Referral 

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!