SPAM must be filtered for accurate Google Analytics

Posted on Posted in Design & Development Tips, Google

This is one of those tips where you might think “isn’t that supposed to happen automatically?”. One would think that adding Google Analytics to your website would give you data in your analytics account that is…from your website. Unfortunately, that’s not always the case. Spammers and hackers can use your website for advancing their own gains while leaving your analytics reporting in an unreliable shambles.

Fortunately for us law-abiding citizens, we have savvy organizations like to figure this stuff out for us so we don’t have to. Here is a screenshot of an account with spam:


As you can see in the above graphic, referrer spam is accounting for over 10% of sessions! According to this article, spammers are using the analytics for the purpose of referrer spam, log spam or referrer bombing. Without getting to into why, let’s just get to how to fix this.

The fix is simply to add a filter to your account that includes your domain(s), therefore excluding the offending spam. Here are the steps:

To effectively block referral spam, do the following in Google Analytics:

  1. Go to ADMIN > All Filters
  2. Click on “ADD FILTER”
  3. Give the filter a name (e.g. “include host only”)
  4. Click on Filter Type “Custom”
  5. Click “Include”
  6. Click “Select Field” and select “Hostname”
  7. Under “Filter Pattern”, add the domain name of your website (e.g. “”)
  8. Apply the filter to any of your profiles.

Step 8 is the step in the following screenshot:


Your filter will be applied going forward. You won’t see the spammer data disappear. To “remove” spammer data, refer to the steps in the above cited article at