Dealing With Referral Spam in Google Analytics
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
buttons-for-website.com. 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.
- Select the Admin tab in Google Analytics
- In the View column, select Filters
- Select New Filter
- Name the filter (something like “Referral Spam,” for example).
- For Filter Type, select Custom.
- For Filter Field, select Campaign Source.
- In the Filter Pattern text box, enter the name of the referrer you wish to exclude, as it appears in your data.
- 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.