IP Exclusion Regex - Google Analytics - IPs not in a range

Hi All,

First of all, not entirely sure where to post this question so figured General Development would be my best bet.

I have a site using Google Analytics and I’d like to filter out internal traffic from the reports. There are about 50 IP addresses to filter, but the problem is they aren’t all in a range. That makes it difficult to filter them out without going 1 by 1.

Rather than stringing together a bunch of expressions to exclude each IP address one by one, I was wondering if I could do
some grouping. For example if I want to exclude these 3 addresses:

xxx.xxx.xxx.1yy
xxx.xxx.xxx.1aa
xxx.xxx.xxx.1zz

Could I create an expression like so:

^xxx\.xxx\.xxx\.(1yy|1aa|1zz)$

If not, is there another way to achieve this?

Yes using a regular expression is the best way. This is actually the only way I know to do this in Google Analytics.

I would be very interested in seeing at least a “rough” example of the regex. And where does it go?

Thanks for the reply.

I’m aware that I have to use regex to exclude the IPs but more specifically my question is whether or not I can group a few together using the following syntax:

^xxx\.xxx\.xxx\.(1yy|1aa|1zz)$

Would that be valid? Thanks.

Yes that would be valid syntax. You can use any valid regex expression.

@Mittineague See http://www.google.com/support/analytics/bin/answer.py?answer=55481 for more details on excluding traffic from Google Analytics.

Thanks. I guess I need to visit Google more often :blush:
For some reason I was thinking it needed to go somewhere in my code, but couldn’t thonk of where, now I know why!

Excellent, thanks. Wasn’t sure if that was valid or not.