<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1639164799743833&amp;ev=PageView&amp;noscript=1">
Diagram Views

Eliminating Referral Spam in Google Analytics

Matt Brady
#Digital Marketing, #Industry Insights, #Inbound Marketing
Published on September 23, 2015

Learn how to stop referral spam from showing up in Google Analytics and ensure that your site's visitor data is accurate.

Google Analytics is an incredibly helpful tool for tracking website traffic, referrals, conversions, and a huge amount of other information about your website. But unfortunately, like any piece of technology on the web, it is prone to abuse by spammers. One of the biggest problems that users of Google Analytics encounter is that of referral spam (which is also sometimes called ghost spam).

What Is Referral Spam?

The Referrals report in Google Analytics (found under Acquisition/All Traffic/Referrals) shows how people found your page, but when you look at this report, is it filled with sites that you don’t recognize? This is due to an ongoing issue in which spammers either crawl a site or send data directly to the Google Analytics servers in order to show up in these reports, hoping that site owners will follow these referrals back to their site, where they can attempt to sell them something like a “magic bullet” SEO solution.

If you’re not sure whether a referral is coming from one of these spammy sources, one easy way to tell is to look at the Bounce Rate and Average Session Duration columns of the Referral report. If the bounce rate of a referral is 100% and the average session duration is 00:00:00, it is most likely referral spam.


If you’re still not sure whether a referral is legitimate, you can also check to see if it is included on a list of known spam referrers.

Update 12/19/16: Learn about the latest type of referral spam, language spam, and how to eliminate it.

How Do I Get Rid of Referral Spam?

There are a few ways you can combat these spammers. One of the easiest is to access the View Settings of your Google Analytics Account and make sure “Exclude all hits from known bots and spiders” is checked:


Unfortunately, while this option may exclude some of the larger known spammers, plenty more will still slip through, and the only effective way to combat them is to filter them out manually. This can be done by editing your site’s .htaccess file or, if you have a WordPress site, installing a plugin like SpamReferrerBlock, but if you don’t have the technical knowledge or capability to do so, your best option is to create filters to block the sites that you see in your Google Analytics reports.

To create a filter, access the view for which you want to filter out referral spam and select Filters. Click the “+ New Filter” button and enter the settings for the new filter. You’ll need to give the filter a name like “Exclude Referral Spam”, then select “Custom” as the Filter Type, “Campaign Source” as the Filter Field, enter the sites to be excluded in the Filter Pattern field, then click Save.


The Filter Pattern field uses regular expressions to determine which information to filter out, and determining how to create these expressions can be a bit tricky. To keep things simple, you can just include the names of each site that you want to filter separated by a | (which means “or”). For example, this expression will filter out adyou.me and best-seo-software.xyz:


However, each filter can only include 250 characters, so you will soon fill up this space, and new filters will need to be created when new referral spammers are discovered. If you want to avoid the cumbersome process of setting up these filters, you can use this application to automatically install filters for a known blacklist of spam sites.

However, while this application is easy to use, it installs over 25 filters to your Google Analytics account, which may make the process of editing or updating them in the future difficult to manage. We prefer to manually update our filters on a regular basis, adding any sites that we see show up in our referral reports.

If you want to make use of the work that we’ve already done to filter out known referral spammers, you can view the the filters we currently use here and use them in your own Google Analytics account.

Setting up these filters will make the data that you gather in Google Analytics much more meaningful, since the numbers won’t be skewed by false traffic. Understanding how real people find your site and how they use it is incredibly valuable, and integrating this information into your other digital channels will allow you to do things like track conversions and personalize content, helping you create the best possible experience for your users and ultimately improving the ROI of your digital strategy.

Do you have any questions for us about Google Analytics, visitor tracking, or how to integrate this data into your digital marketing strategy? Please contact us to speak with an Inbound Marketing expert, or feel free to share any questions or tips of your own in the comments below.