How to Filter Google Analytics Stats for a Perfect Data

In this comprehensive guide, I share my experience with filtering Google Analytics data to achieve the most accurate and relevant information. I found that internal traffic, including that from our technology and marketing teams, significantly skewed our data. To address this, I utilized Google Analytics' filter feature to exclude traffic from our office's static IP addresses. Additionally, I developed a method to block data collection from dynamic IPs at home by modifying the hosts file on various operating systems. This guide offers valuable insights for anyone looking to refine their Google Analytics data for more precise analysis.
How to Filter Google Analytics Stats for a Perfect Data

Over the past few years, I have been using Google Analytics, Clicky, Piwik in combination with WordPress Stats while working on WordPress hosted websites. Yes, when looking to the numbers recorded at all the tracking applications, they are different and this made me look and take deep dive in order to fix the issues. Also, my primary dashboard is configured in Google Analytics which shows all the relevant information at a single look.


Now, while I was checking around and debugging the Analytics report I had to make sure that own people aren’t skewing these Google Analytics data.

The discoveries which I made was surprising, the most active traffic on the website was coming from our team while doing their respective jobs at different pages. Mostly from technology and marketing team. No doubt the analytics data is valuable and I wanted to get it in the purest form possible.

Going further deep into this, I found, Google Analytics was also recording traffic from our IP addresses. Now, I turned out to find a solution to this and stopped at Google Analytic’s filters feature where we can exclude our offices IP address.

Filter the Static IP addresses from Google Analytics:

At our office, the IP address used was Static, so, followed the help tutorial here to filter these IP addresses.

Filter the Dynamic IP addresses from Google Analytics:

Further, I also observed that Google Analytics is collecting data while I was browsing the website from our home internet connection. At home, the IP address used was dynamic and each time with router reboot the IP address used to change.

To fix this in google analytics, I came with a solution to block data collecting domains on the individual system through the host file. On my Windows machine, it is available in C:Windows/System32/drivers/etc/.

Then added the following lines in the hosts’ file and saved it:


On Unix/Linux/BSD systems, you can find hosts file in /etc/hosts/ folder.

On Macs, you can find hosts file in /private/etc/ folder.

You can find the detailed tutorial on how to block access to the internet for a specific domain from here.

In case if you are planning to learn more on how to set up GA in right way, setup segmentation and more, follow the course by Eugen Oprea, which is available for free of cost at Udemy.

Ankit Prakash
Ankit Prakash

Ankit is a seasoned technology entrepreneur and founder of Aritic and EasySendy. With over 10 years of experience building product-led B2B SaaS companies, he is focused on ambitious goals and bringing innovative platforms to market. As a Principal Founder, Ankit leads product, engineering, marketing, and strategic partnerships for Aritic's suite of sales and marketing automation tools. He has grown the brand to over $120M valuation and $8M+ in revenue since 2015. Ankit is passionate about analyzing and reviewing software to provide readers with authoritative, in-depth insights. His articles cover martech, SaaS, entrepreneurship, and other technologies based on his hands-on expertise. He stays on top of industry trends and best practices in product marketing, performance marketing, inbound marketing, and content marketing. His work has been featured in leading publications including G2Crowd, Scoop.It, Brandvertisor, Martech Advisor, Smart Insights, and more. Driven by a dedication to shaping the future of B2B SaaS, Ankit enjoys translating his experiences building, marketing, and scaling companies into actionable thought leadership.

Show all Most Helpful Highest Rating Lowest Rating Add your review
  1. Ankit, thank you this post. Now we get the latest updates inside our google analytics, which ignore our inside traffic. This was an issue happening for long and now we have solution.

    • Great to hear Clark, that this worked for you.
      Yes, getting right information about the analytics stat is quite useful 🙂

  2. Thanks for posting great info sir

    It’s realy helpful articles ,,

Leave a reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.