For any website, you want to install a Google Analytics script to track in depth details of your traffic. It’s a powerful and free tool for you to gather insight into where your traffic is coming from, which pages are viewed the most, highest quality traffic channels, the time your site is most active, and many more valuable data points.
If you’re tracking your own WordPress page views in Google Analytics, you’re going to have problems data integrity – especially for websites that only have a few hundred visitors per month. Having admin traffic being tracked will skew your metrics and give you a false impression of the amount of traffic visiting your website. To fix this problem we only need to create a a few filters in Google Analytics.
- WordPress Post Preview Pages
- WordPress Admin Pages
- Home IP Address
Create a New Filter View
Before creating any filters in Google Analytics, it’s a best to create a new reporting View. A new property View provides you with unfiltered access to all data collected by the Tracking ID and will ensure that if anything goes wrong, you have a Master View with all the data.
- Sign in to your Google Analytics account associated with your website and click on the Admin gear icon at the bottom-left of the page
- On the third column, click the blue button to + Create View
- Keep the data view for Website Insert a new name for this View (ie. “Filtered View”), modify the time zone if needed
- Click Create View and you now have a new view created
Custom Filters for WordPress
With your new Filtered View created, make sure you have the view selected from the drop down before creating a custom filter. You’ll want to create two custom filters here: (1) post preview pages, (2) wp-admin page views.
- Click Filters in the View column and then the red +Add Filter button at the top
- Leave the Choose a method to apply filter to view as Create a new Filter
- Insert a Filter Name (ie. “WordPress Post Preview, WordPress Admin”)
- For Filter Type, select Custom
- Keep Exclude selected and use the filter field drop down to select Request URI
- In the Filter Pattern field, insert preview=true
- Click Save and and then repeat with the Filter Pattern field of wp-admin and then you’re done!
Predefined IP Address Filter
By Google searching “what is my ip address?” you’ll find out your unique IP Address for you to add into Google Analytics to ensure no traffic will be included in your analytics view. If you have other groups or individuals helping you with your website, please remember to also filter their IP Address as well by rinse and repeat the steps below.
- Click Filters in the View column and then the red +Add Filter button at the top
- Leave the Choose a method to apply filter to view as Create a new Filter
- Insert a Filter Name (ie. “(Name) (Location Type)”)
- For Filter Type, select Predefined
- Keep Exclude and traffic from IP Address, and select that are equal to from the last drop down.
- In the IP Address field, insert your unique IP Address
- Click Save and you’re done!
Filtering Complete
Your WordPress website is now filtering any admin page views so you can ensure data integrity and evaluate the traffic you gathered to make data driven decisions.
With over 10+ years of experience in marketing and design, Jiun help businesses manage and execute marketing campaigns, track goal metrics, develop SEO-friendly content, optimize the buyer lifecycle, and collaborate with multiple partners, vendors, and press to maximize a brand’s lead acquisition strategy. Her background in marketing, graphic design, and front-end web development allows her to easily plan, communicate, and develop projects to meet your organizational goals.
Jef
This is exactly what I needed. My data has been corrupted thanks to my ignorance and not knowing how to FILTER urls with my page previews. I have since deleted my old and ugly data, created a new account, and added this filter. Thank you!
Netra
wow it worked???? thank u so much
Chetan Kumar
Hey.
Thank you this wonderful tutorial. But I want to ask one thing When I apply the filter view all the previous data of my Google analytics was gone. So I just want to know that is this normal and What about the tracking code do we need to copy the and paste the tracking code again.
Thank You.
Jiun Wang
Hi Chetan,
I’m glad to hear that you like the tutorial. There are no changes made to the tracking code when adding filters, so don’t worry about having to copy and paste it again.
Sincerely,
Jiun