Referral spam is fake visits, many of which never touched your site. Spot it by hostname, filter it out with a valid hostname filter tested in a separate view, and keep one view completely unfiltered.

Visits from sites nobody recognises

Open the referrals report in Google Analytics on many small business sites and the list includes domains nobody at the business has heard of.

Their names promise traffic, search rankings or free buttons. Every visit from them lasts no time at all, and none reaches a page that matters.

This is referral spam. Some of it comes from robots that load your pages; much of it never touched your site at all.

Either way it lands in your totals, and every trend calculated from those totals is quietly wrong.

Recognising it

The third is the one that settles it. The hostname is the website a visit was recorded on, and a genuine visit to your site carries your domain.

To see it, open Audience, then Technology, then Network, and switch the primary dimension to Hostname.

Ghosts and crawlers

Ghost spam is the stranger kind. The spammer sends made-up visits straight to Google's servers, using tracking IDs tried by the thousand, and some of them land in your account.

Nothing visited your site. That is why the hostname is missing or belongs to somebody else.

Crawler spam is a robot that really does load your pages, faking the referrer as it goes. Its hostname is genuine, so it has to be excluded by its source instead.

Both want the same thing: for you to get curious and visit the domain in the report. Do not. Some of those sites try to install things or collect details, and nothing about cleaning your reports requires opening them.

Why it matters more on a small site

When a site gets only a few hundred visits a month, a few dozen fake sessions change everything calculated from them.

Visits rise for no reason. Bounce rate climbs and time on site falls, because every fake session leaves at once. The share of visitors who enquire drops, though nobody enquired any less.

Decisions follow the figures. A campaign gets credit for growth that is really spam, or a perfectly good page gets rewritten because its numbers look poor.

One view you never touch

Universal Analytics organises data into accounts, properties and views. A view is a window onto a property's data, and filters belong to a view.

Filters are permanent. They change data as it is processed, from the day they are added, and what they remove cannot be recovered.

So the safe arrangement is three views: one with no filters at all, one for testing filters, and the main view you report from.

The unfiltered view is your original record. If a filter turns out to be wrong, it is the only place the truth survives.

The valid hostname filter

First, list the hostnames in the Network report over the past year. Your own domain belongs, with and without www.

So do legitimate services that carry your tracking code, such as a booking system or payment page on another address. Spam hostnames do not.

Write the list down with a note of what each hostname is, so whoever maintains the filter later knows why each one is there.

Then create a custom filter in the test view that includes only traffic whose hostname matches your genuine list. Leave it a week and compare the result with the unfiltered view.

If nothing genuine has gone missing, add the same filter to the main view.

A worked example

A music school teaching piano, guitar and voice from a converted house on a main road watched its monthly visits climb through the autumn.

The owner had started a radio campaign in September, and took the rise as proof it was working. Autumn is a busy season for lessons anyway, which made it easy to believe.

The referral report told another story. Most of the extra visits came from a handful of unfamiliar domains; every one bounced, and none reached the lessons or registration pages.

Switching the network report to hostname showed that most of those sessions had no hostname at all. They had never touched the site.

A test view with a hostname filter, then the same filter on the main view, put the totals back in proportion. The radio campaign was judged on registrations instead, which is where it belonged all along.

Cleaning up the months already recorded

Filters only work forwards. Last autumn's figures stay as they were recorded.

For those months, a segment does the same job without changing anything: an advanced segment that includes only your genuine hostnames, applied whenever you look back.

Note in your yearly record which months were cleaned this way, so next year's comparison is made by the same rule.

The Referral Exclusion List, in the property's tracking settings, is not a spam tool. It is meant for payment pages and the like.

It turns excluded referrals into direct traffic, so the fake visits stay in your totals under another name.

Do tick the bot filtering box in each view's settings as well. It removes known robots, though not the ghosts.

The counter-case

On a busy site, a few dozen fake sessions a month barely move anything, and the filter is tidiness rather than repair.

Spam also comes in waves. Some sites see none for months, and a quarterly look at the referral report is enough for them.

And a hostname filter needs looking after. A new booking system or shop on another address will be filtered out until it is added to the list, which is exactly why the unfiltered view exists.

For most small sites, though, the filter is what makes the numbers mean something again.

Setting it up

  1. Never click the spam domains.
  2. List every hostname from the past year.
  3. Create a view with no filters, and leave it alone.
  4. Test the hostname filter in a separate view.
  5. Apply it to the main view after a week.
  6. Use a segment for months already recorded.
  7. Note the date the filter started.

Step three is the one that cannot be done later. A filter applied without an untouched view is permanent from the first day, and so is any mistake in it.

Why figures compared across years need counting the same way is covered in writing down last year's numbers first.


Frequently asked questions

What is referral spam?

Fake visits recorded in Analytics with a referring site the spammer wants you to visit. They bounce instantly, inflate your totals and distort every trend calculated from them.

What is a ghost session?

A visit that never happened. Spammers send made-up data straight to Google's servers using guessed tracking IDs, so the session has no hostname or one that is not yours.

Why keep a view with no filters?

Because filters permanently change the data they process and cannot be undone. An untouched view keeps the original record if a filter turns out to be wrong.

What does a valid hostname filter do?

It keeps only visits recorded on your own domain and on legitimate services carrying your tracking code, which removes ghost sessions that never touched the site.

Does the Referral Exclusion List remove spam?

No. It is meant for things like payment pages, and it turns excluded referrals into direct traffic, so the fake visits stay in your totals under another name.

Can I clean up months already recorded?

Filters only work from the day they are added. For earlier months, apply a segment that includes only your genuine hostnames whenever you look back.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Visits from sites you have never heard of?

Give us access to your Analytics. We will separate the real visits from the fake ones and keep the original record intact.

Start a Conversation