While Google Analytics is getting better at weeding out referral spam by default, it’s still not perfect. After trying numerous hacks for dealing with annoying spammers like ILoveVitaly.com, Semalt.com, Social-Buttons.com, and Success-SEO.com (not to mention about a hundred others), we finally landed on one that works using a simple filtering technique. Thankfully, it’s extremely easy to set up.
01. Set Up a New View for Your Filter
First, set up a new View to ensure you don’t skew your historical data as this will only affect traffic moving forward. That way, you can continue to make apples-to-apples comparisons of your data before-and-after you set up your filter.
This is important because cutting referral spam out will reduce the amount of traffic you appear to be getting while improving all your other KPIs, like engagement and conversion metrics. The extent of the effects is dependent on how much referral spam you’re receiving, of course, but this is best practice regardless.
02. Create a New Hostname Filter
Okay, now that you have your new view set up, go to Admin -> View -> Filters and create a new filter with the following settings:
“Include only” + “traffic to the hostname” + “that are equal to” + your URL
NOTE: If you have multiple domain names, you’ll want to use a regular expression to match them all. Otherwise, this configuration will work just fine.
Below is an example from our own Analytics profile.
03. Voila! That’s it. Really.
This works because referral spammers don’t know your hostname / URL — they just spam Google Analytics IDs at random, so it never actually points to your URL and therefore gets caught in this simple filter! It’s not a complete solution, but it should eliminate the vast majority of your referral spam data.