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, it 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.
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 do 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 Users Tracking
Why Exclude Logged in WordPress Users from Google Analytics?
Google Analytics is the most popular web analytics tool and helps you to track how your site visitors are interacting with your site. But, your analytics data can be misleading if it’s not precise.
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 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. Now, this isn’t due to an actual increase in traffic, but it’s simply because Google Analytics is tracking your admin visits as real visitors.
So, how can you exclude logged-in users and admins from tracking? Let’s find out…
Automatically Exclude Logged-In Users from Tracking (Easy Way)
There’re many ways to stop tracking WordPress admin visits in Google Analytics.
For instance, you can create an IP address filter and whitelist your IP address. This stops tracking visits originating from that specific IP. That way, it doesn’t confuse the actual traffic with your own traffic.
However, the downside is it’s only applicable if you’re using a static IP address that doesn’t change. Now, this is very difficult to manage and requires a lot of manual work.
A much better solution is to disable logged-in visitors tracking, so you can stop tracking your own visits on your WordPress website, even if you’re using a dynamic IP.
Fortunately, there’s a very simple solution! MonsterInsights makes it really easy to exclude WordPress admin traffic from Google Analytics.
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 User
With MonsterInsights, it’s easy and quick to exclude WordPress admin traffic from Google Analytics reports.
But, if you insist on using Google Analytics without a plugin, you’ll need to create a Google Analytics filter to exclude WordPress traffic. Do note that you’ll have to set up filters for different user roles, which can be time taking.
Here’s how to do that step-by-step.
First, you’ll need to log into your Google Analytics account by visiting their official website. Then, go to the Admin option at the bottom of the left panel.
After that, click the Filters option below the View column.
Then, click the Add Filter Button.
Next, you’ll see a page to add a filter to exclude WordPress admin page traffic. Select Create new filter option.
Then you’ll need to enter a filter name. After that, select Custom from the Filter Type options. You’ll see the Exclude option at the top.
Choose Request URI from Filter Field options and enter wp-login.php in the Filter Pattern field.
Go ahead and click the Save button.
Now Google Analytics will exclude traffic from your WordPress admin page (wp-login.php). If you want to add more user roles to exclude, then you’ll have to create filters for each role.
And that’s it!
We hope this article helped you to learn how to stop Google Analytics from tracking logged-in users to get accurate reports. You can also go through our guide on how to properly set up Google Analytics in WordPress.