Analytics
1.6K members online now
1.6K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

Why isn't this RegEx filtering out my local machines?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I would like to filter out a list of IPs in a view with a RegEx, but I can't understand why some simple ones don't work.

 

Specifically, I want to exclude 130.14.109.* and 130.14.118.* (plus a bunch of others).

The following RegEx successfully excludes both of these: ^130\.14\.

but it excludes too much, of course. However, this one does NOT exclude either of the above: ^130\.14\.1

I've tried the following variations to no avail: ^130\.14\.1.*, ^130\.14\.1.*$, ^130\.14\.1.*

Also, fully specifying an individual machine doesn't work, either. (eg. ^130\.14\.109\.22$)

 

We are NOT using IP Anonymization - just the standard GA Javascript snippet.

Also, if I use a Predefined IP filter, using "begins with", I can get these IPs exluded. However, I have about a dozen of them, and it seems I should be able to use a single RegEx for all of them. We actually have one that works with Angelfish and AWStats, but it doesn't work in Google Analytics.

 

I'm testing using the Real Time overview, which immediately shows when a hit is counted and not. I'm also streaming the Apache access.log so I can see that I'm using the correct IP address.

 

What am I missing?

Thanks,

mike

 

Re: Why isn't this RegEx filtering out my local machines?

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆
This version: ^130\.14\.1 should work.
Maybe there is something wrong with your real-time reporting.
I suggest you to set filter as above and make some test again but check the results in standard reports.

Re: Why isn't this RegEx filtering out my local machines?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Well, I did set up a view with a similar RegEx (^130\.14\.1.*) yesterday afternoon, and it shows the same number of hits as my UNFILTERED view. I just created another view without the trailing .* but both should work, I think. I'll dig a little deeper to verify that some of my local traffic is indeed making into these both of these views. (although everything should get into UNFILTERED...)

Re: Why isn't this RegEx filtering out my local machines?

[ Edited ]
Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

I was wrong about the Predefined filter, also. If I define a "Predefined" Exclude IP filter that "begins with": 130.14.
the machine 130.14.109.22 gets filtered out
but if I use 130.14.1 it does not get filtered out.

Any chance that IP Anonymization is turned on by "default"? That how it seems to be acting, except that anonymization only affects the last octet, and this seems to affect the 3rd octet, too.

Grasping at straws, here...

Re: Why isn't this RegEx filtering out my local machines?

Participant ✭ ✭ ☆
# 5
Participant ✭ ✭ ☆
anonymizeIp isn't enabled by default.
And - as you said - it only affect the last octet in IP address.

You can try to do a different thing. Create a new view and apply IP filter "include only" with your pattern.

Re: Why isn't this RegEx filtering out my local machines?

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Well, at least it's consistent in "Real Time". Include only ^130.14. captures hits from 130.14.109.22, but include only ^130.14.1 does not. I'm about ready to punt. I could write instrument my GA Javascript to capture it using the Tag Manager, but I'm not convinced it's worth the effort:
http://www.lunametrics.com/blog/2014/03/11/goodbye-to-exclude-filters-google-analytics/

Re: Why isn't this RegEx filtering out my local machines?

Participant ✭ ✭ ☆
# 7
Participant ✭ ✭ ☆
I suggest you to contact Google Support in that case.
Because I don't have any more ideas. Sorry.

Re: Why isn't this RegEx filtering out my local machines?

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
Thanks for your help.

Re: Why isn't this RegEx filtering out my local machines?

Explorer ✭ ☆ ☆
# 9
Explorer ✭ ☆ ☆
A trick I found out is that filters are iterative, meaning, as you filter, the next filter takes from that population.

Re: Why isn't this RegEx filtering out my local machines?

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭
That's a good point, but I've been using single-filter views to try to figure out this issue, and nothing seems to work. As soon as I add anything in the third octet of the RegEx - like 130\.14\.1 the filter ceases to catch anything. I'm going to try asking Google Support and see if I get an answer.