stop referer spam

How to filter referrer spam from google analytics historical data

If you have followed along with any of my previous posts on how to block referrer spam from affecting your website analytics, you have successfully filter out any future spam. However, these measures would not affect any of the historical data. In order to clear out the referrer spam you will need to create a custom segment.

Create a custom segment to filter referrer spam from google analytics historical data

Navigate to your Audience Overview dashboard and ensure you have selected All Sessions . This will display all of the default segments that Google Analytics offers. You are going to + Add Segment


A new screen will display and you then need to click + NEW SEGMENT button

new segment

Create New Segment
  • In the left navigation pane select “Conditions”
  • Change “Include” to “Exclude” in the drop down”
  • Select Acquisition and choose “Source””
  • Select “contains”
  • Enter in the referrer spam domain”
  • to add more domains click or”
  • In the top right adjust the “Segment is visible in…” to your preferred setting. The default is to allow any view in the account to have access to this segment.”
  • Hit “+Add Filter””

new segment

A known referer spammer list

In the right hand column you should see how this new segment will affect the number of sessions when it is in use.   Keeping the All Sessions selected and selecting your new segment will display all the data minus the annoying referrer spammers on your historical data.

If you have any further questions please ask in the comments section below or contact me and I will endeavour to respond as soon as I can.

Gary Woodfine

Freelance Full Stack Developer at
Helps businesses by improving their technical proficiencies and eliminating waste from the software development pipelines.

A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.