Dealing With Referral Spam in Google Analytics

  • Jun 2015
  • Read Time: 4 Mins

Referral Spam could be interfering with your web analytics. What can you do about it?

Google Analytics is one of the most useful tools available for evaluating your site’s performance. Unfortunately, it’s also prone to exploitation by the ne’er-do-wells of the web and their unwelcome spam bots. Spam in Google Analytics won’t directly damage your site, but it can distort your web analytics data. This, of course, compromises the overall usefulness of Google Analytics. Those spammers aren’t the most considerate bunch, are they?

Fortunately, there are steps you can take to protect yourself against spam in Google Analytics. We’d like to take this opportunity to explain what referral spam is, how to recognise it, and what you can do about it.

What is Referral Spam?

A referrer is a web address included in the header of an HTTP request. The intended purpose of the referrer field is to indicate the last site visited by a user, so that websites can identify where their visitors are coming from. However, the referrer field is not always used appropriately.

If a spammer wants to promote a particular site, they can make automated HTTP requests which include the address of their chosen site in the referrer field. This will cause this address to appear in the access logs of the sites they target.

A common method used to target Google Analytics users involves using an automated script to target random Google Analytics tracking-IDs (the numbers used to identify individual Google Analytics accounts). Fake HTTP requests are sent to Google Analytics servers, and if your account is targeted, the referrer addresses show up in your data. These are known as “ghost referrals,” because they appear in your Google Analytics data without actually visiting your site.

For the spammer, this is a ploy to drive traffic to their website. This is especially effective where the target sites publish access logs or analytics data, thus giving the spammer’s site a search ranking boost. For you, it means that your Google Analytics data is tainted with useless information that affects metrics like average session time and bounce rate in misleading ways.

How Can I Recognise Referral Spam?

A clear indicator of a ghost referral in Google Analytics is a site visit to a landing page or hostname that doesn’t actually exist on your site. A fake landing page will often have the same address as the source of the referral.

Referral spam is often intended to drive traffic to adult sites and forums. If you notice referrals from web addresses suggestive of adult content, there’s a strong possibility that this is referral spam. Other examples of common sources of referral spam include,, and These sites generally contain advertising and further spam, and the presence of malware is also a possibility. Be advised that you should not visit them.

How Can I Protect Against Referral Spam in Google Analytics?

A straightforward way of dealing with referral spam is to create a filter to exclude undesirable referrers. To do this, follow the instructions below.

  1. Select the Admin tab in Google Analytics
  2. In the View column, select Filters
  3. Select New Filter
  4. Name the filter (something like “Referral Spam,” for example).
  5. For Filter Type, select Custom.
  6. For Filter Field, select Campaign Source.
  7. In the Filter Pattern text box, enter the name of the referrer you wish to exclude, as it appears in your data.
  8. To exclude multiple referrers, you can use a regular expression. Simply list all of the referrers you wish to exclude, separated by the vertical bar character (‘|’).

While this method of stopping referral spam is simple, it’s not perfect. You can only add these exclusion filters after you have already identified ghost referrals in your data, and you’ll need to continue updating the filter as more appear. Next week, we’ll take a look at some more advanced methods of dealing with referral spam in Google Analytics.

For more information about filters in Google Analytics, see Analytics Help.

Nathan Fagan

As our in-house media production professional, Nathan’s primary responsibility is to produce and create high-quality video content for our clients. Alongside his role at Big Dog, Nathan is an award-winning documentary filmmaker and editor. His 2015 short documentary, 'Fallen Bird', won the Audience Award for Best Short Documentary at the IFI Documentary festival and screened at numerous Irish and international festivals. He has just completed his latest documentary, 'Hum'.

Dublin, Ireland