3 easy ways to stop Google Analytics Spam

Google analytics is the most used statistics and analytics tracking script. For one it is free and for two, it has almost all features necessary to make or change your SEO and marketing strategy.

However, if you are reading this now, you might be seeing spam traffic in your analytics.

What is the Spam traffic?

A lot of bots crawl your website daily including search engines. Search engines index your website and you get traffic, so there is a benefit. But some bots crawl for information and for very surprising reasons too… My ip address to get your attention and to get leads in a different way ! This might be a good way to get leads for them but it disrupts our website analytics.

google-spam-analytics

  1.  A screenshot from our own website analytics when it was spammed with some of the spamming websites. (Good news? Our website is now spam free and yours will be too in a few minutes.)
  2. High bounce rate is a negative factor for search engines to index your website.

There are three things you need to worry about if your analytics is suffering from spam:

  1. False analytics ( Hinders your decision making )
  2. Bandwidth usage (Every time a bot loads your page, it consumes your bandwidth unnecessarily and you get nothing out of it. More ever if your host charges you based on your bandwidth usage you will end up paying tonnes.)
  3. Security ( These bots might be looking for vulnerabilities in your website or even collecting information that belongs to you.)

Now to the main part where you learn how to prevent these from spamming you:

There are three methods and we will see each one of them in detail.

  1. Analytics Filters
  2. Block via .htaccess
  3. WordPress plugin

Analytics Filters:

Pretty simple to setup this may be a bit tiring if you have lots of spam websites. The main benefit of this is you will not see the spam websites from your past and present analytics once you set this up.

Click on the „Admin“ tab on the top of your analytics homepage.

Go to „Filters“

how-to-add-filters-1

You will find options to set your preferences.

how-to-add-filters-2

Enter a „filter name“ and choose the filter type as „custom“.

The „Custom“ has many options to choose with which you can block the spam from a particular country, host, referral and many other choices so that your legitimate traffic would not be lost.

The „Verify this filter“ opens a popup showing all sessions that have been removed from the past 7 days analytics.

Block via .htaccess:

The .htaccess file is one of the most important files in your website that you can find in the root directory. A single mistake may lead to website crash, so it is better to make a backup of it before proceeding.

Copy paste this code and add all spam websites in the similar way.

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://.*floating-share-buttons.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*free-social-buttons.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*sexyali.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://.*satellite.maps.ilovevitaly.com/ [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]

This method stops the bots before even before they get on your web server.

WordPress users:

WordPress is the most used content management system in the world and its users are increasing drastically. And now there are plugins that block specific websites. http://www.hostingsreviews.com/3-easy-ways-to-stop-google-analytics-spam/ http://www.hostingsreviews.com/3-easy-ways-to-stop-google-analytics-spam/And adding the websites is pretty simple too. We use the plugin „Referrer Spam Blocker„. It blocks most spam websites and you can add any number of websites without any worry. Though the ratings on the wordpress plugin page isn’t much, the plugin worked perfectly for us.

Using any of the above three methods you can keep spam bots away from your website.

[mailerlite_form form_id=4]