Filtering Referral Spam in Google Analytics

Referral spam can seriously mess with your data in Google Analytics.

Using the filter function can block spammy domains and improve the accuracy of your stats.

  • Edit the View for the website (Property) in question
  • Create a New Filter
  • Set Filter Type to Custom
  • Set to Exclude
  • Select filter field to Referral
  • Create regex expression to filter those spammy domains

Here is an example of such regex based on spam referrals in the data for one of our own sites