Hiding Your Own Traffic From Google Analytics

I recently setup a Google Analytics account on this site in order to get a “second opinion” of my traffic (compared to my regular site statistics). What I noticed pretty quickly is that my own traffic was poisoning my results. So, I set out to hide my own traffic.

Google Analytics offers a couple different ways to hide your own traffic. Basically, you setup a filter and filter traffic based on some criteria. At first, I considered doing it by IP address, but I regularly make connections from wireless access points at home, at work, on trains, at relatives homes, and even at restaurants. It would be pretty difficult to block all those dynamic IP addresses.

My next idea was to setup a special sub-domain, such as example.joeldare.com, and then to filter on that. Right away, I see two possible problems with this approach.

  1. I don't want the general public to use my hidden domain name.
  2. I don't want to accidentally use my regular domain name.

Solving both problems was easy. Here are the steps I took.

  1. Setup “name based hosting” on my web host in order to accept requests from my new hidden domain.
  2. DO NOT set the domain name up on a public DNS server, preventing the public from using it.
  3. Setup the hidden domain in the host file on my home and work computers.
  4. Setup invalid entries for my domains in the host file on my home and work computers, breaking the regular domains, but only for me.

That's it. Now I can access the site through my hidden domain name, I can't accidentally use the real domain name, and the general public can't easily use my hidden domain name.

Finally, at Google Analytics I setup two profiles so that I can see my traffic as it actually is and also with my own traffic excluded.

comments powered by Disqus
hiding_your_own_traffic_from_google_analytics.txt · Last modified: 2020/06/01 22:53 (external edit)