How to Block Internal WordPress Traffic to Show up in Google Analytics?

How to Block Internal WordPress Traffic to Show up in Google Analytics?

Do you want to stop Google Analytics from tracking logged-in WordPress users? In this post, I am going to show you 3 different ways to exclude traffic from your Analytics reports.

I have used these methods for years and they always work for me. I will also show you how to test if your filters are working correctly at the end of this post.

What is Internal Traffic?

Traffic that comes from within your company such as logged-in users, editor, site administrator, or anyone who works on your company’s website. You might not want to track them at least in your Analytics main view.

You can stop Google Analytics to track internal traffic with the help of a filter.

What is Google Analytics Filter?

Simply put, filters allow you to include or exclude certain data in your Analytics reports.

For example, you can exclude traffic from some specific countries to show up in your Google Analytics view. Similarly, you can use a filter to stop a certain IP address from tracking.

The possibilities are endless with what you can do by using Analytics filters. In this post, we will discuss 2 filters and how you can use them correctly.

Use a WordPress Plugin for Google Analytics

This is perhaps the simplest method. I would recommend this especially if you’re a WordPress beginner.

Most Google Analytics plugins for WordPress have an option to exclude logged-in traffic to be tracked. Let me show you how to exclude internal traffic if you use any of these plugins.

1. GAinWP Google Analytics Integration for WordPress

First of all, you need to install Google Analytics on Your WordPress site.

If you’re using GAinWP plugin then here’s how you can exclude your WordPress logged-in traffic:

Step 1: Login to your WordPress dashboard then find Google Analytics from the sidebar menu. Bring your mouse over it, and click on the Tracking Code link.

Exclude logged in WordPress traffic using GADWP WordPress plugin

Step 2: Now you will see multiple tabs in here. Go to Exclude Tracking and check the box next to Administrator, Editor, Author, Contributor, Customer, and Shop Manager. Click on the Save Changes button.

2. Monsterinsights

If you’re using MonsterInsights plugin then here’s how you can exclude tracking for logged in users:

Go to Insights > Settings. Now go to Advanced tab and in the “Exclude These User Roles from Tracking” specify which user roles you’d like to exclude in your reports.

Click on the Save Changes button.

There are many more Google Analytics plugins for WordPress and I am sure most of them must be providing this option to exclude logged-in traffic. So, check your plugin settings and if you don’t find a similar option then contact the plugin developer.

Stop WordPress Logged in User Traffic by using Filter

Now, this might seems like a difficult method but I can assure you it is not. Here’s how to set up a filter to exclude logged-in WordPress traffic from tracking:

Log in to your Analytics account then access the property for which you’d like to use this filter. Make sure that you use a ‘Test View’.

Test view is quite important if you use filters or custom dimensions. You first make changes within test view and when you’re confident they are working correctly, install them in your main Analytics view.

Step 1: Click on the Admin icon from the sidebar. It will bring property settings.

Click on the Filter under the View

Step 2: Click on the Filter button from the view settings.

Click on the Add Filter button

Step 3: Now click on the +ADD FILTER button.

Keep these settings in Filter

Please see the screenshot above.

Filter Name: Exclude Logged-in Users (or give it any other memorable name)

Filter Type: select Custom.

Filter Field: select Request URI from the drop-down menu.

Filter Pattern: type this –> wp-login.php

Click on the Save button. Now your logged-in traffic won’t show up in the Analytics report.

Filter Internal traffic using IP Address Filter

Similarly, you can use a pre-defined IP Address filter in Google Analytics to exclude tracking for your particular IP address. Please note that this filter will only stop tracking the IP address, logged in users with different IP addresses will be tracked.

First of all, you should find out your IP Address. You can do that by simply typing in your browser “What is My IP Address”. Once you know your IP Address, log in to your Analytics account.

Go to a property for which you’d like to filter out traffic then select your test view.

Go to Admin settings > View Settings > Filter. Now, click on the button + ADD FILTER.

Exclude IP Address traffic settings in Google Analytics

Please see the screenshot above.

Filter Name: Exclude IP Address (or give any other memorable name)

Filter Type: Select Predefined

Filter Type: Select Exclude from the drop-down menu

Select Source or Destination to Traffic from the IP addresses

Select expression: select That are equal to

IP address: Paste your IP Address here which we copied earlier.

Click on the Save button.

How to Check if Your Filter is Working Properly?

You can test your filters by using a real-time report in your Analytics. Here’s how

Log in to your Analytics account then go to the view where you have set those filters. Now log in to your WordPress site then visit multiple pages of your site when you are logged in.

Come back to your Analytics real-time report and see whether your pageviews are tracked by Analytics or not.

If it is not tracking your logged in pageviews then you have implemented filters correctly.

However, if you see your page views in a real-time report, your set filter might not be working.

Let me know in the comments if you have any questions regarding this method.

if you find this post helpful, please subscribe to our blog and get access to more actionable resources.

1 thought on “How to Block Internal WordPress Traffic to Show up in Google Analytics?”

Leave a Comment

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