Analytics & Reporting

How to Exclude Internal Traffic in Google Analytics

Your own visits, your team's and your developer's can skew Google Analytics. Here is how to exclude internal traffic with IP filters, cookies and Google Tag Manager, and how to test it safely.

Quick answer: To exclude internal traffic in Universal Analytics, create a view filter that excludes your office IP addresses, and keep an unfiltered view and a test view so you never lose raw data. For staff with changing home IP addresses, set a cookie or a browser flag on their devices and use Google Tag Manager to block or tag their hits. Test every filter in the test view before applying it to your main reporting view, since view filters change data permanently from the moment they are added.

Why internal traffic matters

Every time you, your staff or your developers visit your site, Google Analytics counts it. On a busy site with thousands of visits a day, a few internal visits barely register. On a small business site, internal traffic can be a large share of the total.

That skews your reports in several ways:

  • Inflated sessions and pageviews
  • Lower bounce rates or higher time on page, because staff browse deeply
  • Fake conversions when staff test forms or checkout
  • Misleading landing page and location reports

If you are making decisions based on these numbers, it is worth cleaning them up. An analytics audit usually finds internal traffic as one of the first problems.

Step 1: Set up your views first

In Universal Analytics, filters apply at the view level, and they change data as it is processed. Data filtered out cannot be recovered later. Before adding any filters, set up three views:

  1. Raw data. No filters at all. Never touch it. This is your backup.
  2. Test. Where you try new filters first.
  3. Main reporting view. Where you apply filters once they are tested.

Our guide to Google Analytics views explains how to create and manage them.

Step 2: Exclude office IP addresses

If your team works from an office with a fixed IP address, an IP filter is the simplest option.

Find your IP address

Search “what is my IP” from the office network. Ask your IT provider or internet provider whether it is static. If it changes regularly, an IP filter will stop working without warning.

Create the filter

  1. Go to Admin, choose your test view, and open Filters.
  2. Click Add Filter and give it a clear name, such as “Exclude office IP.”
  3. Choose Predefined, then “Exclude,” “traffic from the IP addresses,” “that are equal to.”
  4. Enter the IP address and save.

For several addresses or a range, choose Custom, then Exclude, then the IP Address field, and enter a regular expression. Keep the expression simple and escape the dots with backslashes.

Test it

Wait a day, then compare the test view with the raw view. Use the Real-Time report while browsing from the office to see whether your visit appears in the test view. If the filter works, apply it to the main reporting view.

Step 3: Handle remote staff and changing IPs

Many teams now work partly from home, on mobile networks, or while traveling. Their IP addresses change, so IP filters do not cover them. There are a few ways to handle this.

The Google Analytics opt-out browser add-on

Google offers an official browser add-on that stops the Google Analytics script from sending data from that browser. It is simple, but staff must install it on every browser and device, and it blocks Google Analytics on every site they visit, not just yours.

A cookie set from a private page

A more flexible approach is to create an unlinked page, such as /internal-traffic/, that sets a cookie in the visitor’s browser. Ask staff to visit it once on each device. Then use Google Tag Manager to treat visitors with that cookie as internal.

Using Google Tag Manager

In Tag Manager:

  1. Create a first-party cookie variable that reads your internal cookie.
  2. Either block the Google Analytics tag when the cookie is present, using a blocking trigger, or
  3. Send a custom dimension such as “Traffic type: internal” with every hit, and filter on that dimension in your views.

The second option is better. Blocking means you lose internal data completely. Tagging means the raw view still shows it, and you can filter it from reporting views. Our guide to Google Tag Manager best practices covers naming and organization so this stays maintainable.

Step 4: Exclude developer and staging traffic

Developers often test on staging sites that use the same tracking ID as production. Staging traffic then appears in your reports with odd hostnames.

Fix it in two ways:

  • Use a separate property or no tracking at all on staging sites.
  • Add an “Include only” hostname filter in your main view so only your real domain is counted.

A hostname filter also helps against ghost referral spam, which often reports fake hostnames.

Step 5: Exclude test conversions

Staff testing forms and checkout create fake goal completions and transactions. If you use the cookie method above, those are excluded automatically. If not, agree on a test email address or a coupon code for internal testing, so you can spot and remove test orders from ecommerce data.

IP anonymization and filters

If you have IP anonymization turned on, Google Analytics removes the last part of the IP address before storing it. Check Google’s help documentation on how this interacts with IP filters for your setup, and test your filter carefully. Office networks that share part of an address with other users may also need a narrower approach, such as the cookie method.

Bot filtering

While you are in the view settings, tick “Exclude all hits from known bots and spiders.” It does not catch everything, but it removes traffic from bots on Google’s known list at no cost.

A note on the new GA4 properties

Google released GA4, the new property type, in October 2020. GA4 properties do not have views, so view filters do not exist there. Internal traffic is handled through GA4’s own data settings instead, and the options are still changing as Google adds features. If you run a GA4 property alongside Universal Analytics, set up the exclusion in both. Our article comparing GA4 vs Universal Analytics explains the main differences.

How to check your filters still work

Filters break quietly. Office IPs change, staff forget to visit the cookie page, and new team members join. Every few months:

  • Compare the raw and main views for sessions and conversions.
  • Browse the site from the office and from home and check the Real-Time report.
  • Review the Network or Service Provider report for your own company name or internet provider.
  • Check that new staff have been added.

Questions people ask

Can I exclude internal traffic from past data?

Not with view filters. They apply only from the moment they are created. You can use segments to hide internal traffic in past reports if you can identify it, for example by a custom dimension or location.

Should I block my own visits completely?

Usually it is better to tag internal traffic and filter it from reporting views, while keeping a raw view with everything. That way you can still see it if needed.

What if my business is small and works from home?

Use the cookie and Tag Manager method, or the browser add-on on your main devices.

Do filters affect real-time reports?

Yes. Real-Time reports respect view filters, which makes them useful for testing.

Summing up

Set up raw, test and main views, exclude fixed office IPs with a filter, handle remote staff with a cookie and Tag Manager, keep staging traffic separate, and review your setup regularly. Clean data makes every other report more trustworthy.

If you want your analytics set up so you can trust the numbers, see our Know what’s working services.

Imran M

About the author

Imran M

Leave a Reply

Your email address will not be published. Required fields are marked *

Ready to improve your website?

Let's build a faster, higher performing website.