Featured Video Play Icon

Stop Google Analytics Ghost Visits

Video Summary

About a month ago I showed you an analytics report that had bad referral data in it. (Here’s a link to that post if you haven’t see it… Does Your SEO Company Suck?)

Then a couple weeks ago I showed you how to eliminate referral spam.

Now, in this video, I am going to show you how to clean up another source of bad analytics data. This time we will eliminate ghost visits.

What are ghost visits?

These show up in your analytics reports as actual visits to your site, but no one ever showed up.

You can find them by going to the Audience Menu, click on Technology, and then choose Network. From there click on Hostname.

Anything you see on the hostname list, that is not a legitimate URL of your website, is a ghost visit.

Is it worth cleaning these up?

You bet it is. I have seen sites with as much as 85% of their visits are ghost visits. Imagine how that is skewing their understanding of what happens on their site!

Creating a filter to block ghost visits is straight forward and easy.

Simply follow along with me on the video, and you can prevent new ghost visits from showing up in your analytics reports.

[Do you like this post? Please share it for me! It motivates me to continue offering brief these videos when you share my work. Thanks.]

Dominate The TopBad Data From Your SEO Firm?

In Dominate The Top you will see how easy it is to rise in the search results without an expensive, incompetent SEO company. Save your money and do it yourself!

CLICK HERE to get it from Amazon or order direct from the author.

 

Video Transcript

Hi, I’m Jeffrey Kirk.

About a month ago I showed you an analytics report that had bad referral data in it. If you haven’t seen that video, revealing the poor job of an SEO company, I am including that link below.
==> Does Your SEO Company Suck

You will also see a link to a post from a few weeks ago when I showed you how to eliminate the referral spam from your analytics report.
==> Eliminate Google Analytics Referral Spam

Now, in today’s video, I want to show you another form of analytics spam and show you how to get rid of it.

Today I am talking about ghost visits.

What Are Ghost Visits?

These show up in your analytics reports as actual visits to your site, but no one ever showed up.

And, unlike referral spam, which fakes a source, but could still visit your site, there is no such visit here. It only looks like there was a visit.

So, how does this happen?

Well, you know you have a snippet of Google Analytics code that you have to put in your website in order to collect the analytics data.

The only difference between my code and yours is the tracking ID number.

So, if I change the tracking ID on my site to your number, suddenly all my website traffic would show up on your report even though the visitors were to my site.

Now if I did this, I would be upset because I cannot see my numbers, so no legitimate website is going to do that on purpose.

But, let’s say I want to inject some data into 1000’s of analytics accounts to draw attention to my own business, I could set up a private web server, put in the Google Analytics code, and then randomly change the ID number with each visit.

Then I have the computer trigger the visits. Suddenly, and very quickly, I could make a big impression across many different businesses.

Of course I would have no idea if one of those sites is yours.

But if I am doing this, and thousands of others are too, then we’re collectively going to impact many sites over and over again.

The good news is that there is a very easy way to set up a filter to block this type of fake visit.

When we blocked referrals, we had to keep making a longer list to stop new traffic sources. We don’t know the source until it starts appearing in our logs.

Easier To Block Than Fake Referrals

Fortunately, this time, we have to set up a filter based on not the source, but the destination.

On a web server, the destination, the site that is showing to the visitor, is called the host.

Since the spammers are picking random tracking ID numbers, they have no idea what host is involved. They do not know your website address, so they cannot know your host name.

Instead, what shows up is either their own hostname or something generic that they decide to use. Typically, they will pick something like google.com or leave the host empty.

If you did not install your tracking code on google.com then there’s no way google.com would be the host for visits to your site.

In this case all we have to do is tell our analytics to only accept data from our own host. All other data contains the ghost visits.

In one quick move we eliminate all the ghost visit spam, with no future adjustments necessary!

Let’s go to my computer and I will show you exactly what to do…

Here Are The Visual Steps To Create The Filter

As I mentioned, most analytics spam seems to come in the form of “ghost visits”. That means that your analytics tracked someone coming to your site who never actually showed up.

To see this, start on the main Google Analytics reporting page, go to the audience menu, and click on Technology. Then click on Network.

This shows all the computer networks that have accessed your website. This information is okay since we expect people to visit from many different service providers.

To see the ghost visits, click on the primary dimension of Hostname.

Anything you see here, on this hostname list, that is not a legitimate URL of your website is a ghost visit.

hostnames view - with ghost visits

So in this case, there are 2 ghost visits that have a hostname of (not set), so we don’t even have a hostname. And then there are two others that are just coming from a specific IP address.

To show you how abundant this can be, I’m going to pull up an old report from Chocolate University Online.

ghost visit hostnames

You can see that the first two are legitimate. They are both chocolateuniversityonline.com.

But then (not set), 79 in a one month period. This one, 4webmasters.org, 10 visits. And, a few others here with single visits. So these 91 visits represent 4.4% of all visits during the month.

That’s not a huge impact in this case, but I have seen examples where the bogus data is more than 50% of the sessions. One site I looked at recently, 85% of the data was unnatural with ghost visits from unwanted hostnames.

The solution in this case is to block all data that is not generated within your own site. By doing this, you are effectively eliminating all those ghost visits.

So, this site, chocolate university online, has filters applied now, so I am going to go back to the other site to show you how to do it.

To eliminate the ghost visits you can add a filter to your Google Analytics account. It is rather easy to do, just follow what I am doing step by step.

But one warning before I show you. If you make a mistake in the filter, you could block all analytics. Your reporting would vanish. Therefore, be cautious and careful when making the changes I specify.

To add the filters, go to the top menu and click on Admin, and then to the third column. Then click on Filters, right here.

Website Filter Settings

Your site will have no filters to begin with (this site already has one that someone else set up). Just click on the Add Filter button.

add filter nameIn Filter Name, give this filter a name that tells you what it does. I always type in “Only Include Site Hostname” because this filter eliminates everything else. So I will do that here.

Then, under Filter Type, click on Custom, and scroll down to where it says Include.

create the hostname filterFor the filter field, select Hostname.

And, in the Filter Pattern box, type in your domain without the www’s. So, for example, this website I am working on right now is www.psccouplings.com. I can put psccouplings.com in the box.

In the event that your analytics are actually tracking more than a single domain, for example if you have a shopping cart hosted elsewhere, and they told you that you can take your google analytics code and put it in that shopping cart, and have analytics track it all as one, then you have to filter more than one domain.

And this filter pattern box will accept 2 or more domains.

To do this, all you would do is use the vertical bar as a separator, not commas, just the vertical bar, sometimes called a pipe. You put that between the domain names.

So that’s the shift of the backslash, and then you would enter the next domain. For example, nextdomain.com. Something like that. And you can have another one if you wanted to, a third domain, and so on.

But we don’t need that, so I’ll go back to pscouplings.com.

When you have it in, go down here where it says Verify this filter, and click that link.

This is going to show you what happens as a result of your filter.

So here, before the filter is applied, it shows the hostname was (not set). There were 2 sessions there and 2 page views. And now, after the filter, this hostname is not going to show up at all.

That is exactly a good representation of what we want, so all is well.

If we discovered we made a mistake, for example, if I have psccouplings.cm, and hit verify again, you can see it will drop psccouplings.com off the list and that would not be desirable.

I can go back up, add the .com back, and test one more time. It all looks good.

When you are ready, click Save.

And now this filter shows up, “Only Include Site Hostname” is an Include-type filter. If you ever need to delete them in the future, you can come back here and click on Remove.

A Few Final Comments

A couple more comments before I leave you.

First, these filters prevent the data from entering your Google Analytics reports. That means you have to be cautious. If you make a mistake in a filter and block good data, there is no way to get it back.

To be extra careful, create a separate view instead of editing the All Web Site Data view. Doing this is the recommended best practice which can save you from unintended consequences.

And finally, keep in mind that these filters will not remove the data from previous reports. They stop new data from being added.

When you run reports with dates after you add the filters, they will be clean. Any reports that include old data will still have the old bogus data.

That’s it for now.

I hope this helps you keep your analytics data clean.

Be sure to subscribe to my web page or the youtube channel so that you are notified when new posts are published. Of course, if you enjoyed this post, please like or share it on your favorite social platform.

And, have a great day!

[If you would like to be notified when new articles are posted, you can subscribe below.]

Jeffrey Kirk

Jeffrey Kirk

Internet Marketing Trainer for Up At Dawn, LLC and at 24x7 Internet Marketing Library
Jeff has more than 20 years of experience working with service-oriented business owners and sales professionals who are struggling to get clients. He helps them get their businesses seen online so they can get more visitors to their websites and convert those visitors into leads and sales. Do you want more leads? Here are the 3 crucial steps to a profitable website.
Jeffrey Kirk

Latest posts by Jeffrey Kirk (see all)

About The Author

Jeffrey Kirk

Jeff has more than 20 years of experience working with service-oriented business owners and sales professionals who are struggling to get clients. He helps them get their businesses seen online so they can get more visitors to their websites and convert those visitors into leads and sales. Do you want more leads? Here are the 3 crucial steps to a profitable website.

Comments