Removing Google Analytics Spam Traffic

Contributor, October 13, 2020

Referral spam traffic can pose a serious threat to the accuracy of referral traffic report in Google Analytics as well as inflate the general traffic numbers.

The most common way spam traffic is being generated is by building dedicated software that will go to your site and then execute your Google Analytics code.  This could be automated by using a bot or a spider in the same way that Google spider sites.  The second way to spam a site is by using the Google API which enables you to send in data to any account in an automated way.  This could be done without even visiting a site.  Unfortunately, there is no way to block these hits because of the way the measurement protocol works.

Before we review as to how to filter the spam data, we recommend that you create an unfiltered view just for the case that you overdo the filters or for the possibility that something else might go wrong.

The first way to block spam traffic is to enable the Bot filtering option in the admin section of Google Analytics.

This option has shown to decrease the referral spam a little bit.

Next option is using the Hostname Filter.  Typically when a spam bot enters a web site it does not include a host name, so we need to build a filter that includes only traffic from known and trusted hostnames.  For example:

Step 1:  Populate the filter name field

Step 2: Filter type select custom

Step 3: Filter Field select option hostname

Step 4: Select the include radio button

Step 5: Under field pattern insert your domain names as regular expressions

Step 6: Click the filter verification option to find out the spam bots

When applying filter verification, the hostname translate.googleuserconte… is a spam bot.

This filter eliminates most of the spam traffic, however, it will not eliminate this issue completely as these software programs can continuously change the names of the host.  The next step is to create spam filters to block each one out individually.  This additional filter will eliminate more spam traffic that the previous filter did not catch.

To prevent and remove spam traffic you need to enable the bot filtering option in the admin panel of Google Analytics, Create a hostname filter to eliminate ghost visits and also individual filters to eliminate any remaining ghost visits.

To learn more and how to create some shortcuts and using Google tag manager to tackle this issue, get in touch with us