How to Block Referral Traffic From darodar.com Spam Bot

You might be aware about darodar referral spam , econom spam, and now the new one rising is ilovevitaly.com as these are spam traffic that are showing in Google Analytics as referral traffic but this is spam and is not good for website. We are going to show you how we can block these spam referral traffic with just single javascript code or php code. You only need to add some simple code in your website.

If you are getting referral URL in Google Analytics that looked a bit like this:
spam traffic

This is a Russian spam network that entices webmaster and it show as affiliate links in Google Analytics. This is a black hat SEO (old time affiliate marketer) techniques that showing in our Analytics result. They simply put 301 redirection and website (darodar referral spam) redirect to any other website.

Here are few steps to block this spam traffic in your Analytics:

 

1. Block Darodar.com, econom.co etc through .htaccess: Simply add below code in your .htaccess file

SetEnvIfNoCase Referer darodar.com spambot=yes
Order allow,deny
Allow from all
Deny from env=spambot

It basically sets a variable called “spambot” – then it assigns all visits from spam sites as that variable. Then it block that variable from entry to your website.

2. Filter Spam Traffic in Google Analytics: If you want to identify real traffic that comes to your pages you can use bot and filtering options in Google Analytics.

You need to go: Admin -> View -> View Setting You will see screen like below:

spam filter traffic

Now use below instructions:

analytics filter

 

3. Add Code in website Header: Add below code in website head tag means before closing head tag:

<script type=’text/javascript’>
 var blocklink = ['http://darodar.com', 'http://econom.co',’http://ilovevitaly.com];
 for (var b = blocklink.length; b–;) {
 if (document.referrer.match(blocklink[b]))
 window.location = “http://google.com/”;
 } 
 </script>

php website user has to add below code in header.php file of theme folder:

<?php
  echo”<script language=’javascript’>
 var blocklink = ['http://darodar.com', 'http://econom.co',’http://ilovevitaly.com'];
 for (var b = blocklink.length; b–;) {
 if (document.referrer.match(blocklink[b]))
 window.location = “http://google.com/”;
 } 
 </script>
 “;
 ?>

Please share this blog and comment when any unknown traffic shows in your analytics or if you have any question regarding spam traffic.

Leave a Reply

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