Everyone is getting to much spam traffic from darodar.com , economy.co , ilovevitaly.com , shoping.ilovevitaly.com , iedit.ilovevitaly.com etc…, Now the question is how to block them, so I have already figured a way to block them using javascript and PHP code but for some users it doesn’t seems to be working. The .htaccess method is not working at all. So now one more thing you can do is to filter them out from your analytics property. That’s not a solution but still you can stop this traffic from showing up and you can have a good look at your websites analytics how they are performing.
So after writing all the method of blocking with .htaccess , javascript and PHP now we will do it with google analytics filters.
Step 1 :
Login to your analytics account and click on admin on the top menu last option.
Step 2 :
Now click on property and select the property from which you want to filter out the spam traffic.
Then click on “Filters” on right side.
Step 3 :
Now click on +NEW FILTER
Step 4:
Now click on Custom as seen in the picture given below. Then write the name of the filter for darodar , for example darodar spam.
Now Click on “Select field” and select referral from drop down menu.
Next in “Filter Pattern” enter “darodar.com”
(adding darodar.com will block all the traffic containing darodar.com , adding ilovevitaly.com will block all traffic from ilovevitaly.com which is shoping.ilovevitaly.com and iedit.ilovevitaly.com)
Now click on save and you will see the finale screen which will look like this.
Follow steps 3 and 4 to add all the spam referral.
Please take note that this method only filters the referral traffic from showing up on your analytics which will improve your overall report.
It will stop analytics from creating new sessions and new users.
This will not completely block the traffic coming to your website.
Finally after adding some filter it will look like this
If you would like to block these spam traffic with javascript or PHP then see below article.
Block all the spams with single javascript and PHP code.
If you want to block all the referral traffic from bad websites then see this article.
Please share and comment for further help.