How to block Google Analytics spam

google analytics spam

What is Google Analytics spam?

Google Analytics spam is a broad phrase that covers referrer spam, direct traffic spam, keyword spam, and other types of spam that targets your Google Analytics data. There are many ways to stop Google Analytics spam from affecting your reports depending on which type of spam is affecting you.

Referrer spam

The most common type of Google Analytics spam is referrer spam. Referrer spam targets your Google Analytics reports with deceptive and fraudulent referral traffic in order to attract you and  persuade you to visit the URL that has been targeting your Google Analytics data. There are different types of referrer spam and different ways to block each type; However, each type of referrer spam can be blocked in your Google Analytics account by creating an exclude filter in with the spam URL (or URLs) as the filter pattern.

block google analytics spam

Common referrer spam URLs and websites that utilize referrer spam to promote themselves includes semalt.com, copyrightclaims.org, snip.tw, traffic2cash.xyz, and many others.

Two types of referrer spam are ghost traffic and bots and spiders. Ghost traffic does not actually land on your website. It just mixes deceptive data into your Google Analytics reports. Bots and spiders are another type of referrer spam that fills your Google Analytics data with deceptive referral traffic. Bots and spiders actually land on your website and this can be troublesome because it can affect your bandwidth and other resources. Bots and spiders can also create links off of your website’s access logs which is then crawled by Google’s bots and seen as a backlink.

If you value your website’s data you will want to block referrer spam in your Google Analytics account. This type of Google Analytics spam can ruin your website’s data provided in Audience, Acquisition, Behavior, and Conversions reports. The image above shows a website’s Google Analytics account which has been targeted by referrer spam traffic. As you can see, the bounce rate is very high. Referrer spam typically lands on a single webpage on your website and leaves from the same webpage creating a 100% bounce rate.

How to block referrer spam with an exclude filter

1. Open your Google Analytics account and go to the Admin tab and click All Filters.

2. Click the + ADD FILTER button to create a new exclude filter.

3. Add a Filter Name that you can remember and relate to this spam.

4. Select the Custom Filter Type.

5. In Filter Field find and select Campaign Source. In the Filter Pattern text box add the spam URL you want to block and click the Save button on the bottom of the page.

To add multiple URLs to the same filter you can make a Filter Pattern similar to this with a | between each URL: example.com | example.com | example.com

How to block referrer spam with your .htaccess file

  1. Copy and paste the code below into your .htaccess file.
  2. Change example.com to the URL you want to block and save your file.
## SITE REFERRER BANNING
RewriteCond %{HTTP_REFERER} example.com [NC,OR]
RewriteCond %{HTTP_REFERER} example.com
RewriteRule .* - [F]

Keyword spam

Keyword spam is a type of Google Analytics spam that targets your website’s Google Analytics data with keywords and phrases like “beat with a shovel the weak google spots addons.mozilla.org/en-US/firefox/ilovevitaly.” Keyword spam usually tries to promote a website in the phrase. It can also simply “Google Bomb” your Google Analytics data with random keywords and phrases like Ghost spam is free from the politics, we dancing like a paralytics. Keyword spam can be blocked in Google Analytics with an exclude filter.

beat-with-a-shovel-the-weak-google-spots

Keyword spam can mess up your Google Analytics data just like referrer spam. Keyword spam can hit your website with deceptive keywords from different locations around the world. This especially affects Google Analytics data in Audience and Acquisition reports.

How to block keyword spam with an exclude filter

1. Open your Google Analytics account and go to the Admin tab and click All Filters.

2. Click the + ADD FILTER button to create a new exclude filter.

3. Add a Filter Name that you can remember and relate to this spam.

4. Select the Custom Filter Type.

5. In the Filter Field select Campaign Term and in the Filter Pattern text box enter the keyword spam phrase. Click Save at the bottom of the page when this is complete.

Also See: How to exclude hits from all known bots and spiders