Google Analytics Address RegEx Tool
Posted on September 27, 2008
4 Comments
One of the handy features of Google Analytics is the “Filters” feature. Want to make sure your visits to your site aren’t tracked? Just create a filter for your external IP address[1] and you’re good to go.
To setup filters you’re going to need to know a little bit about regular expressions. Another term for regex is “achilles heel” – at least for me. I just sweat trying to get my head around anything more advanced than filtering a single IP address… Total brain cramps when I need to filter a small range of addresses, for example.
Fortunately, Google has a nifty little tool buried in the help document titled, “How do I exclude traffic from a range of IP addresses?” There’s regex calculator there!
For instance, want to just filter out one address? Enter that address in the “First IP” field and then click “Generate RegEx”. I entered in 24.12.100.119 and it spit back ^24\.12\.100\.119$. Cool, huh?
It’s even more interesting for ranges, of course. Give it a try and see if it can’t help you a bit.
Oh, and there’s even a primer on regular expressions in the Google Help as well.
[1] Not sure what your external address is? Try a site like whatsmyip.org to find out. Are you a user of Google Mail? Then check the bottom of the screen to see your current address.
Tags: google-analytics, network, regex, regular-expression
Comments
4 Responses to “Google Analytics Address RegEx Tool”
Leave a Reply
Please read the "Comments" section on the Disclaimer page. Don't use SEO terms instead of a name. That drives me nuts.
Oh, and contrary to what you might have read on some SEO forum, this is not a "Do Follow" blog.





Okay, can you now tell me why one would want to exclude IP addresses? I’m trying to understand this idea.
Can you explain the difference between external and internal IP’s?
Thanks, for I am new to all this. I think what your saying is google analytics will track my visits as unique visitor? So, its best to filter my IP so that it’s not counted as traffic?
Just a little confused is all…
Internal IP” is another term for a non-routable IP address. An IP address is a unique identifier on the Internet, like a telephone number, and non-routable means that a router will never forward packets to a computer or other device that has a non-routable IP address (if you don’t know what a router is, find the “what is a router” question on this site).
“External IP” is another term for a routable IP address. When people talk about internal and external IPs, they are usually talking about a NAT router. NAT stands for Network Address Translation, and the form of it that most people are familiar with is the form that allows multiple computers to share a single Internet connection via one physical connection to the ISP. If you have a NAT router in your home, each computer connected to it has an internal IP, while the router itself is assigned an external IP. If you didn’t have a router, the external IP would be assigned to whatever computer is connected to your ISP.
@Pete: Number one reason to exclude IP address(es): You don’t want your own views of your site to be counted. That’s why I exclude my home address, for instance.
If you use wordpress and install wp-stat you’ll find out that it doesn’t count your own views