Mastodon
How to filter referral spam from your website

In these days, huge number of websites are affected by some form of the referrer spam, resulting in annoyance and misrepresented website traffic analysis.

If you are affected by referrer spam in your Analytics, you should be able to follow couple of simple options to prevent them from spoiling your data. This spam traffic doesn’t generate actual website visits, just create fake stats into your website traffic analysis.

1. Block via .htaccess

The most effective way to block referrers from accessing your site at all is to block them directly in your .htaccess file in the root directory of your domain. If you want to get creative, you can redirect the traffic back to their site. Be carefull when editing your .htaccess file, always perform backup. Example of how to block most notorious Russian spam:
  • # Block Russian Referrer Spam
  • RewriteEngine on
  • RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.com/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly.\.ru/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.org/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*ilovevitaly\.info/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*iloveitaly\.ru/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*econom\.co/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*savetubevideo\.com/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*kambasoft\.com/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*buttons\-for\-website\.com/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*semalt\.com/ [NC,OR]
  • RewriteCond %{HTTP_REFERER} ^http://.*darodar\.com/ [NC]
  • RewriteRule ^(.*)$ – [F,L]

2. Filter the spam in Google Analytics:

Currently, the best solution of filtering is to apply view level filters to exclude referrer spam (not retroactive) and also report filters and advanced segments (retroactive). You can use this regular expression to block a few of the most annoying spammers out there and you can add also the custom filter reflecting your specific need. Look the picture for detailed view. Example how to filter common referral spam in Google Analytics: darodar\.|semalt\.|buttons-for.*?website|videos-for|ilovevitaly|prodvigator|cenokos\.|-seo|adcash\.|share.?buttons\.|social.?buttons\.|hulfingtonpost\.|free.*traffic|buy-cheap-online|ranksonic\.|seo-|blackhatworth If you spot a new spam domain you need to add a vertical line (“|”) and then the name of the domain. Escape dots by adding a backslash (“\”) before them. As you can see I prefer not to add the whole domain, but just the unique part of it, but this would vary between domains.

3. New Bot and Spider Filtering Feature in Google Analytics

A number of bots and spiders are constantly crawling the internet websites which generates fake visits to your traffic analysis. Simple way how to prevent the most notorious bots and spider affect your analysis is to enable Bot filtering in Reporting View Settings. Check the picture for detailed view.

To have relavant data about your audience is essential for improving your website performance and delivering even better experience to your on-line visitors. We can help you to install and interpret the analytical data about your website.

Facebook
Twitter
LinkedIn
Reddit
Pinterest
Telegram