Can't find what you are looking for?

Email us at or call us on 023 9283 0281. Alternatively, fill out the form on our contact us page.

Fish disguised as shark

How to remove fake referrals from Google Analytics

Categories: SEO

Fake referrals are increasingly becoming a big problem for anyone who uses Google Analytics. If you’ve noticed some odd, spammy-looking referrals in your GA account, you need to get rid of them, fast.

Referral spam can seriously skew your GA data and, in extreme situations, damage the reputation of your website. If you’re having issues with spam and dodgy referrals, here’s how to put a stop to them.

How harmful is referral spam?

First and foremost, spam referrals mess up your GA data. If you’re a large business receiving thousands of visits a day, you probably won’t have noticed any dramatic changes – smaller sites suffer the most. Fake referrals usually have a 100 per cent bounce rate and an extremely low time on page; if you don’t receive much traffic, this fake data can really skew your reports.

Most fake referrals are trying to send traffic to their dodgy sites in order to boost their own SEO rankings. Do not click on these URLs – you will likely be redirected to a suspect ecommerce site, a marketing scam or a site containing malware.

In extreme situations, your site could be framed as a spam referrer. A spammer wishing to send unqualified traffic could just alter the name of the referral URL to whatever they wanted, including the victim’s URL, as referral spam cannot be authenticated.

There are two main types of referral spam – ghost referrals and non-ghost referrals. I’ll explain the difference between the two and how to stop them appearing in your reports below.

Stopping ghost referrals

Ghost referrals are where the spammer has never actually visited your website, just tricked GA into thinking it has. It does this by sending spammy data directly to GA. However, we at Vertical Leap ain’t afraid of no ghost (referral), and you shouldn’t be either.

First, you need to create a new view on GA. Head to the admin section to do this. We’re going to filter out these ghost referrals by only allowing valid hostnames to filter through. Valid hostnames are those which belong to you, such as your site’s URL.

To find out which valid hostnames you need to allow, go to the Audience section on GA then look under Technology and then Network. Switch the primary dimension to hostname and ensure the date range is set to at least a year, so you catch all the hostnames. Remember, only the hostnames that are yours (or you recognise) are valid. For example, our valid hostnames include:

  • Our development server

All sites need to include that last hostname in their filter, as that is how your site is viewed through Google Translate.

Now you need to put all the valid hostnames into one line of text. Separate each site with a pipe (|) character and place a backslash (\) before every full stop. This will create a regular expression (RegEx) that ensures nothing but the valid hostnames will get through the filter.

BEFORE you filter your data, though, you need to build a segment and test it on your historical data. This will confirm the RegEx actually works – otherwise you risk messing up your data even further.

In the View you want to analyse, click on the Reporting tab and then on ‘Add Segment’. From here, you can create a new segment. Enter a name for it and then click on the Conditions tab to test your filter. You’ll need to filter the sessions that include your valid hostnames. If you click test, you’ll see what percentage of sessions will be affected – ‘preview’ will show you how the segment alters your current report.

Once you’re sure it will work, create a new custom filter. It should look like this:

Add filter for fake referrals in GA

Remember, you can view filtered historical data via the segment you created, but filtered views only start to collect data after the filter is applied – it can’t change historical data. This is why it’s important to test your filter first!

Removing non-ghost referral spam

Some spam bots do actually visit your site; these are called non-ghost referrals. Unfortunately, these cannot be filtered out by the above method. To stop them, we need to create another filter; this one to exclude spam referrals.

To find out which sites you need to block referrals from, head to Acquisition in GA. Then, select Referrals under All Traffic. Change the secondary dimension to ‘hostname’. Like so:

How to set the secondary dimension to hostname in GA

Genuine referrals will have your hostname correct in most cases, just likes all the sources in the screenshot above. However, it is also worth looking at the metrics of the source. As I’ve said before, high bounce rates, low time on page and a low number of pages/sessions are all usually signs of a spammer. Here are some sites you definitely need to include in your non-ghost referral filter:


Of course there are many, many others, but these seem to be some of the top offenders.

Just like before, create a RegEx code which includes all the sites you need to block. Create a new segment and test your filter on your historical data to make sure it’s definitely filtering out all the spam referrals. Once you’re sure it’s working, create a new view and apply the filter. It should look like this:

Add filter to View in Google Analytics

You may need to create more than one filter, as the filter pattern field has a character limit of 255. Plus you’ll need to check your GA regularly for new spam referrals, as new bots are popping up all the time.

If you have a WordPress site, you can try using the SpamReferrerBlock plugin, which filters incoming traffic for you. This should stop non-ghost referrals appearing in your GA, but results may vary.

Here to help

If you have any further questions, just give our digital marketing advisors a call on 0845 123 2753 or click below.

Request a call from one of our digital marketing advisors »

Back to top