Referral Spam

Block Referral Spam in Google Analytics

In this article we’ll teach how to to block in Google Trends, as well as explain what is

Fake visits to your site? Here’s what’s probably causing them.

There’s a great variety of ways that hackers use so as to spread spam throughout the internet. Spam e-mails, fake ads etc. If you’ve noticed that your website’s been getting more visits than usual but eventually they’ve all turned out to be fake, then you’re probably dealing with a referral spam such as – one of the latest of its kind. This is a method commonly used by hackers, which enables them to promote their sites by artificially increasing their visitors count. This effectively boosts the site’s google analytics rating and increases it’s chances of getting shown in google search results. This spam method does not pose danger to your site or online security. However, it really messes up your google analytics stats and makes you unable to tell how many real visitors you actually have.

What is What is referral spam?

Earlier referral spam programs, now known as classic referral spam, used spam bots to generate visits on people’s sites. However, after some time google managed to deal with those. Thus this method could no longer be used. Instead, hackers had to come up with another way of creating fake impressions on different websites. In 2014 a newer, more advanced referral spam type of program was created – ghost spam. This new kind of spam code does not need to use bots in order to generate visits. Instead, it simply changes google’s analytics’ stats, thus artificially generating visits to the targeted website that are not actually real. falls under the category of Ghost spam. Currently google is unable to fully deal with that issue. This makes Ghost spam that more popular with hackers and virtual crooks.

“But how exactly does this help the hackers themselves?” – you may ask. Well it’s quite simple and at first sight might not seem all that efficient. The main purpose of the artificial generation of visits for your site is so that it induces your interest and curiosity to check out where all these visits to your site are coming from. Even if only 10% of the targeted sites’ admins go to investigate where those views are coming from, this would still generate a very big amount of visitors for the hacker’s site. This, in terms, will earns higher ranking for that site in the google’s statistics effectively increasing it’s popularity (via artificial means). Another important thing to note here is that if your logs are public, this will enable any search engines, such as google, to see all those fake url’s coming from the referral spam program – this further increases the hacker’s site rank in the analytics stats.

Why and how you should be dealing with the ghost spam

As we mentioned earlier, there’s still no harm done to you or your site. Your traffic is not being stolen and your rank is not being altered by However, it still messes up your stats and makes you unable to clearly see how much visits you’re actually getting. This can be extremely frustrating if your work and income depends on your site’s viewers. Therefore, you’ll need to find a way to deal with that nagging issue before it gets out of hand. Below this article, there’s a guide that will help you resolve that problem and bring everything back to normal.

However, before we go there, we have several important tips for you on what to do and what not to do, should you be dealing with a referral spam.

  • Many of you might have heard about referral exclusion list – this list is effective against classic referral spam. However, since nobody’s really using this nowadays, the chances are that the spam comes from direct intervention into your analytics stats which is the work of a ghost spam. If you include a ghost spam in the exclusion list it will have the opposite effect. As we said, the visits that are not real and once the exclusion tool goes to check what’s wrong, it will not detect any actual visits to your site from the hacker’s URL. Once this happens, google analytics will mark this URL as legit and from then on it’s visits (that actually never occur) will be counted as legit and will not fall under the spam category.
  • Instead of using the referral exclusion list, you should consider investing a little extra money into reliable quality spam filters. To get better spam filters, you might want to also consider choosing good, high-end hosting company, that will not allow any fake visits or other spam to get to your website. Just know that paying little more will almost always be the better option in the long run.

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!

Leave a Comment