How to Remove Referral Spam From Google Analytics

Data Analytics

For our initial installment of #MetricsMonday, we are tackling the frustrating spam technique that’s been ruining analytics data for over a year with no end in sight: the dreaded referral spam. This post will cover how to identify referral spam, why referral spam needs to be removed from reports, and finally, how to eliminate referral spam from Google Analytics.

What is referral spam?

Referral spam, also known as ghost referrals, is fake referral traffic recorded in Google Analytics using spam bot crawlers. The goal of this spamming tactic is for users to find these URLs in their referral traffic data and visit the website, effectively as a free form of advertising.

Most of the time, these referral spam sites lead to fake or potentially malicious websites commonly hosted in countries like Russia, Indonesia, and Brazil. Some referral spam sites (including Semalt, which pioneered the referral spam practice) do provide a genuine service. However, their sleazy marketing tactics make trusting them a highly dubious feat.

How to identify referral spam and why it should be removed

Often, you will see a huge spike in referral traffic and initially think someone built a great link that’s bringing in a lot of new, interested users to the site. That is, until you take a look at the engagement metrics.

Beyond the obviously spammy names of many of these referring sites, (i.e., and, referral spam commonly records traffic sessions with 100 percent bounce rate and 0:00 average time on site.

Spam Referral Google Analytics Example

Why is this bad? In addition to inflating the number of referral sessions, it also significantly impacts engagement metrics. Depending on the amount of overall traffic your site gets per month, having hundreds of spam referral sessions recording a high bounce rate, no time on site and one page per session can significantly impact these valuable metrics. Notice the difference in this site’s referral traffic metrics with spam referrals filtered out:


Although more than half of all sessions are filtered out, there’s a dramatic improvement in the bounce rate, pages per session, and average session duration.

What should I do to eliminate referral spam?

You will find many articles online recommending tactics for eliminating referral spam, but these recommendations are often inaccurate or ineffective.

The most common advice includes adding these spam sites to the referral exclusion list, filtering out countries where referral spam commonly originates, or simply clicking the Bot Filtering button that excludes all hits from known bots and spiders.

Using the referral exclusion list will record the referral spam as direct traffic but it won’t eliminate it. Filtering by country is somewhat effective, but is not advised for international websites where legitimate traffic from those countries may be filtered out. Spam bots reside all over the globe so this tactic may not catch everything. Clicking the Bot Filtering button under View Settings in the admin panel is always recommended, but it hasn’t proven effective for eliminating all referral spam.


Of course, creating custom advanced filters and updating the .htaccess file can block traffic from known bots; the only issue with this tactic is new bots appear every month and will inevitably corrupt your historical data. So what is the best tactic to ensure all your data is as accurate is possible? Use advanced segments to remove referral traffic from your historical data.

Setting up advanced segments to remove referral spam

Advanced segments are temporary filters that do not permanently remove data and traffic. They excel where custom filters fall short by removing historical data that may distort overall traffic figures. Since many of these spam bots are fly-by-night and here today, gone tomorrow, you have to constantly keep up with the newest batches of bots. Some new spam referrals may hit your Google Analytics data before you have a chance to add them to a filter, so the advanced segment is your best catchall for preventing any spam from affecting your historical data.

If you’ve never filtered out any referral spam, it’s essential to look at historical referral traffic dating back to around August 2014, when referral spam first became prominent in Analytics reports.

Some of the most common spam referrers include:


If you see any of these URLs in your historical referral data, they need to be included in your advanced segment.

To determine the rest of the spammers, look for sources with either 100 percent or 0 percent bounce rate. Most of the time, these referrers will also record 0:00 average time on site and one page/session; however, some bots will actually visit your site and record time and page views, so be vigilant to these as well.

Next, take the following steps to set up an advanced segment that removes referral spam from your historical traffic data.

Step 1:
View your referral traffic data by clicking on Acquisitions > All Traffic > Referrals and identify all referral spam using the recommendations above.

Step 2:
Click on the All Sessions segment above the data graph and then click the +New Segment button.


Step 3:
Name your new advanced segment “Exclude Referral Spam” or any name you prefer for this action.


Step 4:
Configure the segment conditions to exclude sources that match regular expressions (“matches regex”).


Step 5:
Add all known spam referrers as regular expressions, using “|” rather than spaces and adding “\” before any periods (i.e., “semalt\.com|buttons-for-website\.com|adf\.ly”). Read more about how to use regular expressions.


Step 6:
Save and view your natural traffic without the skewed data of spam referrals.

As new spam referrals appear every month, it is essential to add them to the spam exclusion segment. Click Actions on your segment and select Edit. Then, add new spam referral sources as you did in Step 5.

On a monthly basis, edit and update your spam referrals list in Google Analytics.

Stay tuned for more handy Google Analytics tips from Bonfire Marketing as part of our ongoing #MetricsMonday series.

Related resources:

More Content


Leave A Comment

Bonfire Marketing

407 NE 12th Avenue, Portland, Oregon 97232

Phone: 503-334-2071