How to Exclude Internal Traffic from Google Analytics

Google Logo with the word Analytics under it and text "How to Exclude Internal Traffic from Google Analytics"

Google Analytics is an important tool that can help you or any website owner monitor visitor traffic.

It gives you a snapshot of your audience including their location, how they found your website, who they are, and what devices they use (such as desktop or mobile).

But often website owners don’t realize that they are inflating their traffic counts because they are including their own visits in the counts.

Therefore, this blog post will show you how to exclude internal traffic from Google Analytics so that your visitor counts are accurate.

Why We Use Google Analytics

With Google Analytics, you can monitor visitors in real time and see what web page they are viewing.  You can track their locations,  the keywords and sites that referred them, and you can even see conversions as they happen.

Monitoring visitors in real time can be helpful when you are getting ready to roll out a website update.

If you notice a lot of traffic at a certain time of day, you may choose to hold off on rolling out that update until there is less activity.

But before you can exclude internal visits from Google Analytics, you need to have Google Analytics code embedded into your website!

So make sure that’s done and then come back here to see how to exclude your visits.

Dynamic IPs

If your ISP assigns you a dynamic ISP every time you log on, you will most likely want to install the Google Analytics Opt-Out Browser Add-On.

If that’ s you, skip the following section and go directly to the instructions below.

How to Exclude Internal Traffic from Google Analytics

Static IPS

First, you will need to create filters to exclude any internal IP addresses that could inflate your visitor count.

My research led me to a free e-book by Ana Hoffman entitled “Mommy, Where Does Traffic Come From?”  published by Traffic Generation Café.  I was reminded that Google Analytics tracks any and all visits to your site including your employees, virtual assistants, or the freelancers you hire to help you.

For many years the fix was quite simple.  In Google Analytics, you need to create a filter with a list of IP addresses that should be excluded from your traffic counts.

And this was how you did it.

How to Exclude an IP Address in Google Analytics

Determine the IP addresses of all those who work on your site including web designers, virtual assistants, and any other freelancers.

You can look up an IP Address at: http://whatismyipaddress.com.

Next log into your Google Analytics dashboard, click the Admin tab, and select the website property that needs the filter as shown below:

Google Analytics Filter

Click the +New Filter button:

Google Analytic Filter

Follow the steps in the screenshot below:

How to Create a Google Analytics Filter

That’s all there is to it!

Your direct traffic counts will most likely drop once the filter is applied. But from then on you will be correctly tracking your direct traffic.

There are a few other issues of which you need to be aware and they are explained below.

Dynamic IP vs. Static IP

However, depending on your Internet Service Provider (ISP), your IP address might keep changing.

This is because your ISP is using Dynamic IP addressing, which means you will be assigned a different IP every time you log on to your computer.

A Static IP, on the other hand, never changes. So if you have a need to know exactly what your IP address is, you will need to have a Static IP. The pros and cons of each if beyond the scope of this post, but you can learn more here.

In this case, we had to set a conditional filter that excluded IP addresses that began with certain numbers. The first two parts of the IP remained constant, so those were the numbers we had to match in our filter.

Once done, we had effectively filtered his IP from direct traffic counts.

Update: 10/11/2019

Best Way to Exclude Internal Traffic from Google Analytics

Dynamic IP

No matter what I did to try and block internal visits to our website, they kept showing in Google Analytics.

And I suspected it was the dynamic IP address that was being tracked as a new visit every time.

So I began the search to find the best way to exclude internal traffic from Google Analytics in 2019 and beyond.

That led me to a Google support article which explains how you can effectively exclude that traffic.

Google Analytics Opt-Out Browser Add-On

Google Analytics opt-out browser add-on is the tool you need to stop the Google Analytics JavaScript from sharing your internal visits.

And you need to get the appropriate extension depending on what browser you are using.

So do a Google search and find the extension you need.

I use Firefox so this is how I added the extension:

Firefox Extension for Google Analytics Opt-Out

  1. From your Firefox browser, go to https://tools.google.com/dlpage/gaoptout?hl=en
  2. Download and save this file: “gaoptoutaddon_1.0.8.xpi”
  3. Do NOT click on the file because you most likely do NOT have a program that opens xpi files
  4. Instead open the folder containing the file “gaoptoutaddon_1.0.8.xpi”
  5. Next open a new Firefox tab
  6. Select Add-ons from the menu
  7. Drag and drop that downloaded file onto the list of currently available extensions

Then give it a few days to ensure that your internal visits are not being tracked.

And, as a side note, refrain from checking your site on mobile devices as this script does not work on them.

Changing Your WordPress Theme

Most WordPress themes provide a place for Google Analytics tracking code right within the theme options.

However, when you change your theme, most of the time you will lose this code.

That means that you will no longer be tracking your visitor counts. So it’s super important to remember to grab that tracking code and place it into your new theme.

Over to You!

So by now you should understand the importance of excluding internal traffic from your analytics.

And hopefully, you’ll remember to include your tracking code if and when you change your WordPress theme.

Any other Google Analytics tips you care to share? We’d love to hear them!

Editor’s note: This post was originally published in June 2015. It has been rewritten and updated for accuracy.

15
Leave a Reply

avatar
5 Comment threads
10 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
5 Comment authors
RobWRobin StrohmaierAna HoffmanMichelle PhillipsDeb Potts Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
RobW
Guest
RobW

Michelle – I still have a concern about excluding dynamic IP’s. I live in Italy and our ISP is Telecom Italia. Their IP numbering goes like this XX XX XXX XX. Over a 4 week period i checked every time I logged on and every day the IP address was different. The only consistent numbers were the first 2 – either 72 or 83. Therefore excluding a range in GA is out of the question ie everything from 72 or 83 onwards as I will be excluding other users, within those range exclusions surely, who visit the site and are… Read more »

Michelle Phillips
Guest
Michelle Phillips

Hi Rob, thanks for your comment and you raise an excellent question. I just wanted to let you know I’m looking into this further and hope to have additional information within a day or so.

RobW
Guest
RobW

Thanks Michelle for getting back so quickly. Will be interesting what you come up with. Enjoy the morrow!

Michelle Phillips
Guest
Michelle Phillips

My pleasure, Rob, and thanks! I asked Woei Yu Choo, a colleague and a contributor to this blog, if she could add her expertise to this thread. Here is what she has advised: 1. Add a filter. You can tell Google to ignore all URLs with a particular query string value. For example, I can create a filter called “CountMeOut” and if I load a page such as the following one: https://www.codefetti.com/how-to-exclude-internal-traffic-from-google-analytics/%20/?utm_campaign=CountMeOut then Google will ignore this user. Unfortunately, as you can see, it works if you have the utm_campaign=CountMeOut at the end of the string. If you click on… Read more »

RobW
Guest
RobW

Michelle – that’s really helpful and please thank your colleague for her input and time. I will certainly try them and see which works best, although the cookie route does sound rather a no-no I think. I have looked at the add-on but I’ve read that it has some funnies which also throw up odd results and does not appear to have had many recent comments, or rather, not that many. I may well write to the developer himself to tell me honestly how efficient it is. Sometimes a very direct question elucidate a straight answer back. I do though… Read more »

Michelle Phillips
Guest
Michelle Phillips

That would be great if you post your results here, Rob; thanks. I certainly will correct the post once we sort through this! I’m still researching, too, and will also post updates as I learn more.

RobW
Guest
RobW

No problem at all in coming back Michelle. That’s the only way we get issues like this resolved for the good of everyone. Take care and I’ll be back as soon as possible. I’m in Italy as you know, but don’t burn ye olde turkey tomorrow. Enjoy the day.

Michelle Phillips
Guest
Michelle Phillips

OK, another solution from Ramie Phillips, III, Cyber Security Specialist (https://www.ramiephillips.com): “If you block 2 octets like suggested you will block 65,536 addresses approx. 2^16. That is really not that many, but chances are that the traffic is geographically locally close to you. To minimize damage one could use the subnet mask on the internet connection to determine the minimum range that should be ignored. Warning: a client may get IPs from different ranges at different times. This is still a pretty bad solution. Client side is the way I do it. I use ad block with a custom rule… Read more »

Robin Strohmaier
Guest

Fantastic post, Michelle! I’m a huge fan of Ana Hoffman and it is great to see her commenting here!

You are right. Some website owners do not realize that they are inflating their traffic counts because they are including their own visits in the counts. You have done an excellent job showing how to exclude internal traffic from Google Analytics so that your visitor counts are accurate.

I will be sharing this!

Michelle Phillips
Guest
Michelle Phillips

Thank you, Robin! I’m always happy to get your feedback, and I’m glad you found this post helpful. I really appreciate you sharing it, too!

Ana Hoffman
Guest

Hey, Michelle; thanks so much for the shout – glad you found my ebook useful.

Michelle Phillips
Guest
Michelle Phillips

My pleasure, Ana! Nice to see you hear 🙂 I so appreciate the helpful content you share. Thanks for taking time to leave a comment!

Deb Potts
Guest
Deb Potts

oH MY GOODNESS! Thanks once again Michelle. I have been looking at my own visits to my website. LOL I am so glad you are posting these things to keep me on track!

Michelle Phillips
Guest
Michelle Phillips

You’re welcome, Debbie. It’s such a simple thing to overlook, isn’t it? You might notice a big reduction in site visits once you exclude your IP address, but you’ll be tracking everything correctly from this point forward! Thanks for taking the time to comment! 🙂

Deb Potts
Guest
Deb Potts

oH MY GOODNESS! Thanks once again Michelle. I have been looking at my own visits to my website. LOL I am so glad you are posting these things to keep me on track!

Scroll to Top

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close