How to Filter Out Referrer Spam in Google Analytics

For Lawyers, Doctors, and Dentists

Page 1 Solutions -
February 12, 2016
Remove Referral Spam in Google Analytics

Small businesses and marketing agencies alike both rely on numbers for pretty much everything they do. When it comes to any digital marketing efforts, it's important to use some sort of analytics platform like Google Analytics, KissMetrics, Clicktale or Crazyegg. The most widely-used analytics platform is Google Analytics, not only because it's free (but does have a premium version) but because it's made by Google, the network that most marketing agencies consider the highest priority over the other two search engines, Bing and Yahoo. 

Before I make any marketing decision, I always look at the numbers. Numbers don't lie, but in the case of Google Analytics they can be extremely deceiving because of something called "Referral Spam." While this post will not go into specifics of how referral spam comes about and the technical details behind it, it will show you how to filter it out. It's very important to note that the below method does not stop the referral spam data from getting into your analytics, it just allows you to separate the real data from the fake data.

First let's take a look at a client of ours who utilizes a variety of our legal marketing services from SEO for lawyers, video marketing and social media. His Google Analytics data for the past year looks like this: 


At first glance, this data looks amazing!  Almost 75,000 sessions and 60,000 unique users. But where are these users coming from? To find out we can check the referrers by going to Acquisition --> All Traffic --> Referrals. For this same client during the same time frame as the above data, here are their top sites that people are coming from:

For these top 10 referrers, 9 of them are referrer spam (also called ghost spam.) They hold no value to a business and skew a significant number of other metrics in Google Analytics. Just these 9 referrers alone generated a total of 32,519 sessions. All of these sessions are fake. Since most business decisions are influenced by metrics and KPIs like those in Google Analytics, not filtering out this fake data can lead to making decisions that can significantly hurt your business. 

So how does one filter out bad data and remove referrer spam? 

Removal of referral spam can be done through the use of 'Segments' in Google Analytics. By applying a custom segment, you can historically remove the bad data and be left with the data that is coming from valid sources. 

The creation of the segment involves using RegEx (learn about RegEx here)  filters set to exclude entries where the Medium exactly matches 'referral' AND the Source matches the spam site. New referrer spam entries are being created all the time, so it's a constant game of cat and mouse. To simplify this process, I have created a Google Analytics segment that is public in the Google Analytics Solutions Gallery which I update regularly with new referral spam sources. You can see these segments by going to the Google Solutions Gallery (have to be logged in to the Google account you use for your analytics) and using the search query "author:"Andrew Wasyluk"

Importing and Applying Segment into Google Analytics

1. To use the pre-created segment, go to the following link (while logged into your Google account which you access Google Analytics with):
2. Click "Import"
Inline image 1
3. On the following screen, click the radio button labeled "Any View"
Inline image 2
4. Once the segment is imported, you need to apply the segment. To do this, click on the "+ Add Segment" button on the top of your Analytics window.
Inline image 3
5. In the search box labeled "Search segments" start typing "Remove Spam Bot Referrers" and select the checkbox next to the segment that appears and click "Apply"
Inline image 4
6. Once the segment is applied, you will be shown two sets of data: one which is "All Sessions" (meaning both the good and the bad data) and another set labeled "RemoveSpam Bot Referrers" 
Inline image 5
7. To only be shown you REAL data, you must remove the segment labeled "All Sessions." To do this, click on the down arrow next to the box labeled  "All Sessions" then click "Remove." Once the "All Sessions" segment has been removed, you will only be shown data that does not contain the most prevalent referrer spam.
Inline image 6

Once you've imported the segment, you can apply it to any view across any analytics property that you manage. If this segment was applied to the client which was used as an example at the beginning of this post, there is a significant difference between all the data which is displayed upon login and the data displayed with the referral spam segment applied.

As you can see, there is a huge difference between what the data showed before the segment was applied, and what the real data shows after the referrer spam segment is applied. 

Written by Andrew Wasyluk. Andrew is a social media specialist at Page1Solutions