I have written some article to block darodar.com ilovevitaly.com econom.co referral traffic. Now the new one i’m getting hits on my blog is ilovevitaly.co . Its the same as previous ilovevitaly.com spam but as we have blocked it spammers did changed the domain name to ilovevitaly.co , but don’t worry we can also block ilovevitaly.co.
In this article i’m going to show you all the methods of blocking these spam traffic. You have already blocked previous darodar and econom with the .htaccess , javascript and PHP code.also I have written to filter them out with analytics. Here are some articles I have previously written.
What is spam traffic and how to avoid them.
Block darodar ilovevitaly and econom with javascript and PHP code.
Block darodar.com with .htaccess code.
I have seen many people talking about that these spammers are using analytics code to show up in analytics but that’s not true. I have seen many websites getting referral traffic which is using other analytics like yandex and piwik. which displays the same referral links. If you want to filter them then use the below link which will guide you to create analytics filter to block spam traffic.
Block all the spam traffic with the help of analytics filters.
So now lets block ilovevitaly.co with all the method.
1 .htaccess code
You need to have access to your .htaccess file to use this method. Some of the website owners may be using wix , squarespace to create website then they need to add javascript code or they can filter out this spam traffic with analytics filters. Which is given below.
SetEnvIfNoCase Referer ilovevitaly.co spamlink=yes
Order allow,deny
Allow from all
Deny from env=spamlink
2. Javascript code
If you want to use javascript code then you have to add this script between your head tag. This code simply redirects the traffic coming from spam referrer to another website so that you can prevent them from showing up in your anaytics.
var blocklink = ['http://ilovevitaly.co'];
for (var b = blocklink.length; b--;) {
if (document.referrer.match(blocklink[b]))
window.location = "http://google.com/";
}
3. PHP code
You will have to add this code in your header.php file inside the theme folder you are using. You need to paste the code between header tag.
$blocklink = ['http://ilovevitaly.co'];
foreach ($blocklink as $value) {
if ($_SERVER['HTTP_REFERRER'] == $value)
header('Location: http://google.com/');
}
If the above code does’t work and if you get any error then add below code. This is just a javascript code which is added inside head tag with the help of php.
echo"
var blocklink = ['http://ilovevitaly.co'];
for (var b = blocklink.length; b--;) {
if (document.referrer.match(blocklink[b]))
window.location = "http://google.com/";
}
";
?>
4. Using analytics filter
If any of the above method doesn’t seem to work then use analytics filter to avoid them being showing in your analytics results. Read below article which guides step to step to create analytics filter to block any spam traffic.
Filter spam traffic with google analytics.
Please share and comment for any other help.
4 Comments
urashita
Hi,
I tried this code, but does not seem to work.
var blocklink = [‘http://*darodar.com’, ‘http://econom.co’,’http://*ilovevitaly.com’, ‘http://*ilovevitaly.co’ ];
for (var b = blocklink.length; b–;) {
if (document.referrer.match(blocklink[b]))
window.location = “http://google.com/”;
}
I do not want to write specific url but *, because spammer will try to make a lot of subdomain.
Do you have any ideas?
Ashish Prajapati
I’m also confused. We don’t know how these spammers are showing the traftic in analytics. The code works when they visit the site. If not then .htaccess should work. But that also not working. Now the only thing we can do is to filter them out from analytics.
I’m trying to look how they are spamming , only that way we can do something.
Thanks
Ashish
urashita
I am using nginx and found that normal referer block such as this does not work.
if ($http_referer ~* (darodar.com|econom.co)) {
return 403;
}
I am also researching how I can block them technically not ignoring them.
Giorgio
Why does it happen? Why these spam visitors? I can’t understand the reason…what do they earn from “visiting” websites? I created my website and after a While I started to receive “Visits from Darodar, Iloveitaly and now blackthatworth!!! I can’t understand their reason…I put the filter on Analytics…