Do you want to stop Google Analytics from tracking logged in users? By default, Google Analytics tracks each and every pageview on your site, including admin pageviews and visits by bots.
So, when you’re writing, editing, and previewing your site, Analytics records each of your visits as a real pageview and prepares reports including those logged in pageviews.
The downside of those reports is that they prevent you from seeing your real website metrics, excluding your own traffic.
So, in this article, we’ll show you how to stop Google Analytics from tracking logged-in users in WordPress. There are 2 ways you can exclude users. You can skip ahead to any section you’re interested in learning about.
- Easy Way – Automatically Exclude Logged-In Users with MonsterInsights
- Manual Way – Add Filters in Google Analytics to Exclude Internal Traffic
Why Exclude Logged in WordPress Users from Google Analytics?
Google Analytics is the most popular web analytics tool that helps you to track how your site visitors are interacting with your site. But, your analytics data can be misleading if it’s not totally accurate.
One of the most common reasons why Google Analytics reports can be inaccurate is because it’s tracking logged-in users.
When you’re logged in as an administrator, author, editor, or any other user role in WordPress and previewing your site, Google Analytics counts your visits as real visits and adds to your site’s total visits.
As a result, you may see a spike in your pageviews that’s entirely from your own visits to your site.
Let’s take a look at how can you exclude logged-in users and admins from tracking.
Automatically Exclude Logged-In Users from Tracking (Easy Way)
There’re a few ways to stop tracking WordPress admin visits in Google Analytics.
The easiest solution by far is to use a plugin. MonsterInsights makes it incredibly easy to exclude WordPress admin traffic from Google Analytics.
MonsterInsights is the best Google Analytics plugin for WordPress. It allows you to easily connect your WordPress site with Google Analytics so you can view all the data that matters most right in your WordPress dashboard.
Plus, with the click of a button, you can set up sophisticated tracking features such as event tracking, eCommerce tracking, form tracking, custom dimension tracking, outbound link tracking, and more.
Once you have MonsterInsights installed, simply go to Insights » Settings from your WordPress dashboard and click on the Advanced tab at the top.
Now under the Permissions box, you can add different roles under Exclude These User Roles From Tracking option.
After specifying the user roles you’d like to exclude, click Save Changes.
Another advantage of using MonsterInsights is that it doesn’t track admin users by default. When you login to your WordPress dashboard, MonsterInsights will show you a popup to remind you that you’re not skewing your data.
This way your data remains accurate and you can continue to make changes to your website without having to worry about messing up your tracking data.
You’ve successfully stopped tracking visits from the specified user roles in Google Analytics. Now, let’s take a look at a more complicated way of excluding admin users from tracking.
Manually Create Filters to Exclude Logged-In Users
If you decide on using Google Analytics without a plugin, you’ll need to create a Google Analytics filter to exclude WordPress traffic.
Here’s how to do that step-by-step.
First, log in to your Google Analytics account, and select the website you’d like to create a filter for.
Then, click Admin in the left taskbar.
In the Property column, click Data Streams. Then, click into the data stream that your website is tracking with.
Then, scroll down and click on Configure tag settings:
On the next screen, scroll down and click Show all:
Now, click Define internal traffic:
Next, you’ll want to create your internal traffic rule. To do that, click the blue Create button:
Here is where you’ll create your internal IP address rule. Give your rule a name (like “main office”). You’ll see in the dropdown down below where you have several different options for calling out your IP address or a range of them. When you have it set they way you’d like, click the blue Create button.
Now that your rule is created, you have to tell Google Analytics to exclude traffic using that rule. To do that, head back to the main GA4 admin screen and click on Data Settings » Data filters:
On the next screen, you’ll see a filter that was automatically created for you when you created your internal traffic rule. However, note that it’s in testing mode – it’s not excluding your internal traffic yet!
To change this, click on the arrow:
Then, scroll down and click the Active radio button. Once Active is selected, make sure to click Save.
We hope this article helped you to learn how to stop Google Analytics from tracking logged-in users to get accurate reports. Now, check out our guide on How to Track Link Clicks in Google Analytics 4 and WordPress.