Referral spammers have been making their way into our Google Analytics (GA) data without ever actually visiting our websites since around 2013.
Referral spam may show up to administrators as either a fake traffic referral, a search term, or a direct visit.
Referral spambots hijack the referrer that displays in your GA referral traffic, indicating a page visit from their preferred site even though a user has not viewed the page.
Referral spam can’t actually harm your site by triggering a fake visit (as long as you don’t click on the spam link).
The problem is that marketers have to manually decipher and filter this type of traffic out of their GA data to make proper sense of it.
Since we rely on GA to make major ongoing marketing decisions, clean data means everything to us.
Without knowing about referral spam and how to filter it, marketers could be making weighted conclusions based on bogus bot traffic.
In this column, marketers will learn how to clean their Google Analytics data by filtering referral spam.
If you’ve recently migrated to Google Analytics 4, we’ve got a section in here for you too.
For the Love of Filters, What Is Referral Spam?
Referral spam, also known as referrer spam or ghost spam, is created by spam bots that are made to visit websites and artificially trigger a page view.
It sounds sketchy, but bots are just pieces of programmed script that are designed to complete a task automatically online.
It’s estimated that 37% of website activity is created by bots, and less than half of this bot activity is legit.
Desirable bots include:
- Search crawlers creating search engine results pages.
- Checkers monitoring the health of your website.
- Feed fetchers converting content to a mobile format.
The other half of bots aren’t so noble.
Some are designed specifically to spam our referral reports by sending false HTTP requests to our websites with the ability to create non-human traffic otherwise known as bot traffic.
You Cannot Weigh Your Gold with Garbage on the Scale
Referral spam artificially inflates your Google Analytics data.
The level of artificial inflation depends on the amount of referral spam your website is getting, which can vary depending on your industry.
Similarly, the threat this traffic poses to the integrity of your data is directly proportional to the amount of legitimate traffic your website receives on a normal day.
For example, if you receive thousands or even tens of thousands of visits every month, your data won’t be significantly skewed by a couple of hundred spam referral sessions.
However, if you only receive 50-100 visits every month, a couple of hundred spam referrals would throw off your GA data completely, effectively suffocating legitimate traffic.
If you aren’t aware of this problem, it can be very dangerous to your marketing strategy.
How to Filter Referral Spam in Universal Analytics
It’s a nuisance to have bots spamming our websites.
The good news is that it has historically been pretty straightforward to filter this type of traffic.
However, the plot thickened in October 2020, when Google launched Google Analytics 4.
We’ll discuss referral spam in this new version of GA in the next section.
For now, let’s see how to achieve this important task inside your Universal Analytics account.
Make sure that you have the necessary permissions to make changes in your Google Analytics account at the Admin level and then navigate there.
To get started, first create a new view.
It’s a best practice in GA to test new configurations like filters in a new view, instead of in your default raw data view since changes can be permanent and mistakes can be made along the way.
Click on Create View on the far right-hand column (if the View column is not visible to you, it could be because you are now in Google Analytics 4):
Select the type of view you are creating, either Website or Mobile app.
Then give it a name, and select the same regions and time zone as your main view to make sure you’re comparing apples to apples:
Google will do the bulk of the referral spam filtering work for you automatically.
Navigate to your test view View Settings and ensure that the option to Exclude all hits from known bots and spiders is selected:
By checking this off, you’ll automatically and easily be able to filter out about 75-80% of bot traffic.
Another best practice is to add an annotation to mark the date you started filtering bot traffic.
Annotations act as a helpful reference to remember significant changes over time and can help teams keep a record of these types of changes.
To create a new annotation, simply click on the little arrow under any chart in Google Analytics and follow the instructions:
Next, you’ll have to do a bit of manual work to weed out any remaining spam making it through Google’s filter.
But before you can do that, you need to know which spam sites are getting in.
How Do You Identify Spam Referral Traffic in GA?
Other indicators are a bounce rate of either 0 or 100%, a session time of 0 seconds (it’s easy to see how data could become skewed with outliers like these), and a hostname referral that’s not set.
With the list of “bad referrers,” you can block them manually.
Head over to your Referrals report, and filter by descending bounce rate.
Now, apply an advanced filter to only show a number of sessions over a certain threshold.
That number can vary according to your traffic volume.
In the example below 50 was used.
To identify suspected spam referral sites, use the pointers above.
You’ll have to do as much verification as you can without actually clicking through and visiting these spammy websites.
Be careful, though; you may want to check with other departments to make sure these sites aren’t related to some kind of failed advertising attempt.
It is important to roll out filtering in your test view account first.
Once these sites are filtered, they’re gone for good (so you better be damn sure that it truly is spam!).
Once you’re sure, create your list in Notepad or Text Editor so you can paste it back into GA.
Cut down all the URLs to their top-level domain (TLD).
For example, af401e8c.linkbabes.com is an affiliate of linkbabes.com, so it’s better to just add linkbabes.com to your potential referral exclusion list.
Now create a regular expression with your list of URLs, so it looks like the example below from Moz:
Be careful to separate websites with a pipe bar, and to add a backslash in front of the domain extension.
This will allow for other subdomains belonging to that TLD to be excluded, as well.
Now, you’re finally ready to create your filter!
Navigate to your new testing view, click on Filters, then Add Filter to create a new one.
Give your new filter a descriptive name like Referral Spam for easy identification later on.
Change your Filter Type to Custom, and change the Exclude Filter Field to Campaign Source (not the Referral field).
Finally, paste your pre-made list of referral spam URLs:
Once you start filtering referral spam, you can start to see how much it was and is affecting your traffic.
It could account for a fair portion of your website traffic if left unchecked, so it’s easy to see why search marketers get annoyed by it.
Blocking Referral Spam Using Data Filters in Google Analytics 4
If you’ve recently started using Google Analytics, or actively migrated your Universal Analytics account, you should have a Google Analytics 4 (GA 4) property (which is now the default).
While digital marketers are going to love the new engagement tab, setting up filters for spam referrers looks different now.
Most prominently is the fact that in the new Google Analytics 4 Admin interface, the View column is no longer present.
Instead, GA 4 uses Data Streams, which does not have its own column.
Marketers are getting confused now because so much of what we used to do in GA falls under “View” and many how-to articles like these will need to be updated to slow the creation of threads like these.
With the new GA 4, marketers can create up to 10 data filters per property.
Internal traffic filters are suggested and somewhat pre-configured.
However, currently, there are only two types of filters available:
- Developer Traffic
- Internal Traffic
Neither of these seems appropriate for filtering external referral spam.
What’s more, if you turn to Google support for help, you find yourself in an endless loop between Google’s top-drawer banner that tells you to navigate to Google Analytics 4 support and the search bar on that page that takes you back to the Universal Analytics results for filtering referral domains.
We’ve reached out to Google to clarify exactly how to do this in GA 4, and they confirmed that it isn’t yet possible (current at time of publication).
“…since GA4 is a new upgraded product in Analytics, thus the feature i.e “Referral Exclusions” are yet to be launched in GA. Different resources have different timelines, so we cannot assure a specific date for the launch. However, I would like to inform you that the feature is being worked upon…”
While we wait for the ability to exclude referral spam in GA4, I recommend creating an old and new version of Google Analytics:
- One in your legacy Universal Analytics mode.
- And a new one in Google Analytics 4 mode.
Follow the instructions from the previous section in Universal Analytics to filter referral spam from your GA reports for now.
The good news is that this new iteration of Google Analytics has testing built-in, so it won’t be necessary to create new views for implementing new configurations:
The Benefits of Weeding Out Referrer Spam
Clean data is everything when it comes to making meaningful and actionable conclusions based on it.
With these powerful tactics behind you, you’ll be able to filter referral spam so you can make decisions based on facts.
Since referral spam can hit lower-traffic websites even harder than larger sites, it’s important that marketing teams of all sizes stay on top of it.
That means checking for new referral spam websites regularly and adding them to your exclusion list.
Remember to keep your Universal Analytics view alive for now, until we know more about how to exclude referral spam in Google Analytics 4.
- Google Analytics Gets 4 Powerful New Features
- 10 Great Google Analytics Alternatives
- How to Set up Google Analytics Goals & 7 Tips to Get Ahead
All screenshots taken by author, November 2020
In-Post Image 1: Screenshot via Ahrefs