How to Filter Referrer Spam in Google Analytics

James Rehwald
, Marketing Director

Google Analytics Spam

Spam.  No, not the canned meat product, but the inbound digital garbage that you never ever want to see, no matter where it pops up.  Its form could be as simple as an unexpected product advertisement or a more complex scheme that exploits your personal info, downloads malware, and pulls money from your pocket.

They always manage to somehow find you, whether it’s through email, text, social media posts/comments, internet forums, blog comments, and here it comes…web traffic.  Thanks to Google Analytics, you can put a name to the spammy web traffic bots that ruin your data and deteriorate your marketing decisions.


► Website not looking or working right?
Tell us about it.


What Is Referrer Spam?

Referrer spam.  Also called referral spam, log spam, referral bombing, crawler spam, and some other fun names.

Referrer spam is a search engine spamming technique where a web crawler, usually behind a brand name, uses a fake referrer URL to make repeated visits to your website.  Their intent is to make you think that another website is feeding legit traffic into your website.

In Google Analytics, you’ll see this effect under your web traffic’s referral list.  To see this list, click “Acquisition,” then click “All Traffic,” and then click “Referrals.”  Google Analytics will then list the URLs of websites that send traffic to your website for your pre-selected data range.

For many small businesses, as much as over half of your web traffic can be from referrer spam bots.

Yeah, referrer spam can be that badly prevalent – Yikes.

The intention here behind the bots is to advertise.  Website owners look at their Analytics, they see a website is getting them loads of traffic, they visit the website to see how they linked to you, and then they get fooled into giving away information, spending money, or downloading software.  These referrer spam URLs have all sorts of suspicious names such as,,,,, and countless others, some harder to spot.

If you are unsure of whether a URL listed is referrer spam versus a legitimate friendly website, check the site’s new sessions, bounce rate, new users, and average session duration as indicators.  The bounce rate and/or new sessions will likely be 0% or 100%.  The average session duration will be 00:00:00 or unusually long.  In some cases, new users might be 0.  These suspicious numbers are because the bot visits your site and bounces out multiple times, making it look as though your website is receiving several sessions from that referral website.

See the Google Analytics referrals image below to see what I mean.

Spam Referrals Google Analytics

Don’t get fooled into thinking these referrer websites’ offers to give you more traffic are legitimate.  I wouldn’t even visit them on your browser – it can put your computer security at risk.


How Does It Affect My Website?

Referrer spam doesn’t necessarily hurt your search rank, or SEO at all, in fact.  Rather, it skews your analytical web data.  Your sessions and engagement rates may be inaccurate due to higher bounce rates and shorter session durations.  This makes it harder to make educated marketing decisions based on these important numbers.

Removing/preventing these spam bots from crawling your website and fixing your Google Analytics data doesn’t help your ranking but will give you a much better picture of who actually visits your website, where from, how often, and why.

Filtering out spam bots from your website it good for business.

Don’t let referrer spam misguide you and your marketing decisions.

Stop Spam Analytics


So How Do I Filter Them?

The following steps will show you how to locate and block specific spam bots from crawling your website in the future.

  • First, you need to identify your referrer spam bots.

Open your Google Analytics and with the date range selected for the past year, click the “Admin” tab at the top-left.

Click “Acquisition,” then click “All Traffic,” and then click “Referrals.”

Here, you will see a list of referral website sources sorted by number of sessions.

Using the criteria I discussed in the “What Is Referrer Spam?” section, identify the referrer spam bots and then copy and paste all the domains into Notepad – you’ll use these domains in the next step below.

  • Second, you need to set up a filter that blocks these bots from returning to your website.

With your Google Analytics open and the date range selected for the past year, click the “Admin” tab at the top-left.

Make sure your “View” is selected to “All Web Site Data.”

Click “Filters” under view.

Click “+ ADD FILTER”

Make sure the “Create new Filter” bubble is filled.

Name your “Filter Name” to something like “Referrer Spam for”

For “Filter Type,” make sure to click “Custom.”

Make sure the “Exclude” bubble is filled in and then for “Filter Field,” select “Campaign Source.”

For the “Filter Pattern” text box, you’ll want to make sure you type this part in correctly (check out this Google support guide for using the right expressions).  Here, you will list out the referrer spam bots’ domain names that you originally saw listed under your site’s “Referrals” web traffic.

You are limited to 255 characters per filter, so split them up if you have a lot of referrer spam bot domains to type in.

In the instance of our website, I blocked out referrer bots with these two expressions:




See the Google Analytics filter view screenshot below.

Google Analytics Filter View

Once your filter(s) are complete, hit the “Save” button at the bottom.

And that’s it!  You can also click “Verify this filter” to see how the filter would affect your view based on the previous 7 days of web traffic.

To maintain your filter so that it is up-to-date, make frequent checks (perhaps once a week) to your “Referrals” list see if new, unfamiliar crawlers are hitting your website and then add the domain(s) to a preexisting or new filter.

Depending on the amount of web traffic your website receives, you may need to check this “Referrals” list more often.

For a large list of popular spam domain names, visit Ohow’s article and then scroll down to “Spam List (Crawler and Ghost).”


Ghost Spam?  Clearing Spam Out of My Historical Data?

While referrer spam exists, so does ghost spam, something webhosts may consider to be the worse evil of the two spams.

This type of spam functions differently in that it doesn’t actually visit your website but rather manipulates your Google Analytics data using a fake source and hostname.

Pacman Ghosts

To block ghost spam, you’ll need to make a “valid hostname filter” which relies on carefully authenticating the sources of your website’s visits.  You will need to create a filter that blocks all sources that aren’t using your specific hostname(s).  With this method, you need to be extra careful because leaving out legitimate hostname(s) from the list could entail blocking legitimate website traffic.  You don’t want that.

While this process is a bit more complicated than the referrer spam filter, it requires less maintenance over time and is a great preventative solution.

This filter, plus the referrer spam filter, are two great filters put together for blocking a majority of spam traffic – this will maximize the value of your Analytics data.

Visit Ohow’s article and scroll down to the "Valid Hostname Filter (For Ghost Spam)" title to see a step-by-step processfor setting up a ghost spam filter.

Also, if you want to clear up the referrer and ghost spam out of your historical data for a clearer view of your website’s past performance, you can use advanced segments to accomplish this.

To use advanced segments, visit this other Ohow article for an in-depth tutorial.

Of course, spam is always finding new ways to evolve and with that, spam-blocking procedures must adapt.  Be sure to stay up-to-date with industry news and spam-blocking methods for your website, as well as any other digital platforms that your business may use.


Need help with measuring your website performance or blocking spam?  Or perhaps help with building, promoting, or managing a website?
As experts in Drupal and WordPress development, we can help you with that.
Contact DDG today!


Read more from our Blog:
Local SEO Is the Way to Go
How to Make the Best Facebook Event
11 Key Tips to Increase Engagement on Your Facebook Page
5 On-site SEO Tips You Don’t Want to Forget


Add new comment