Digital Marketing Blog

Latest Trends in the Field of Digital Marketing

Google Analytics | Digital Strategy | Analytics
Analytics Attribution Digital Marketing

How to Fight the Google Analytics Referral Spam Issue

Referral spam occurs when your website gets traffic from unusual Bot and suspicious referrals and this traffic is recorded in Google Analytics, invalidating the account data (for example, increasing the number of total visits). These data must be deleted from Google Analytics, here’s how.
Bots are programs designed to automatically perform repetitive tasks. There are several Bot designed to visit websites over and over. These visits are recorded in Google Analytics, ruining useful real visitors data.
There is an endless list of Bots of this type and there are multiple reasons why they are created and launched in search of websites to visit:

  • Store the content of the site
  • Inflate the number of visits to a website
  • Spread malware and viruses
  • Search for e-mails on web pages and store them

There are good and bad Bots. Among the good is Google’s one (GoogleBot), whose purpose is to visit your website and index its content. Usually good Bots visit the website infrequently, while the bad ones are persistent.

A way to find spam Bots:

  1. Access Google Analytics and select a fairly long period (a month, a year, it depends on the total amount of visits to your site) and enter the Referral report (Acquisition > All traffic > Referrals).
  2. Sort the table for decreasing Bounce Rate (from 100% down), or create a traffic segment with a Bounce Rate equal to 100%. Take a look also at those with few visits. Often you find the same domain among many visits, but with a different top-level domain (eg .: www.example.com, xyz.example.com, 234.example.com, etc.)
  3. Look for referrals with a Bounce Rate of 100% and a considerable number of visits (eg.: more than 10); this should help you to distinguish the suspicious referrers from genuine visits by humans interested in your content; anyway be careful about the names of the referrals you find.


In the above chart, the six results are definitely spam Bots, because the site has no reason to be linked and receive so many visits (with a high bounce rate) from sites that have nothing to do with the spontaneous generation of links to its pages. Do not visit those sites! Most often they contain malware that can infect your computer (it is the reason they try to lure you on their pages).

How to filter out spam referrers data from Google Analytics?

The first thing to check in Analytics is if the “Bot Filtering” box is ticked in your view settings, as in the below picture:

In order to eliminate this type of spam visits from your account you have to setup a filter in your main view of the Google Analytics account. You have to setup a Custom filter that excludes “Campaign Source”, and on the “Filter Pattern” you should list the known domains you previously found in the Referral report, separated by a pipe (“|”). There is a limit of 128 characters for filter; if you need to add more domains you should create multiple filters.

If you want to avoid the hassle of creating each filter individually you can use the Spam Filter Installer – an online tool by Simo Ahava that connects with your Google Analytics accounts and automatically install multiple filters on the views you select. The filters take into account this list of spambots by LoneGoat. It is being constantly updated, but because of the appearance ratio of new spam referrers you may want also to add your own filter, after analyzing your traffic data.
If, instead, you want to hide the bad spam referrals from your historical data, check out our article about how to clear spam referrers with segments.
Another way of dealing with spambots, this time from the server side, is to add blocking rules to your .htaccess file:
## SITE REFERRER BLOCK
RewriteCond %{HTTP_REFERER} semalt.com [NC,OR]
RewriteCond %{HTTP_REFERER} buttons-for-website.com [NC,OR]
RewriteCond %{HTTP_REFERER} seoanalyses.com [NC]
RewriteRule .* – [F]

At the moment Google seems not to put enough effort to stop this emerging problem, but we all hope that they will soon come up with an integrated solution.
by Federico Conti