Reputation: 5666
I can't seem to block my own traffic in Google Analytics. Reading up on the topic, I created a new view, added filters to exclude Nagios, our own traffic, one referral type and another filter to work with unsupplied search terms. In general, the filters work, as the one working with unsupplied search terms does its job, yet my filter for traffic from our static IP doesn't seem to be blocked.
Here's my filter:
Predefined -> Exclude -> traffic from IP address -> that is equal to -> our IP address
I've double checked, and it's definitely our address, yet having GA open, then opening our site in a new tab shows our session.
I'm not sure what to do from here. One Google Answer said to write the IP address as a regex and gave the example
123\.123\.123\.123
but GA won't let me insert this address (invalid address), so I guess it's not a regex field.
Upvotes: 1
Views: 3411
Reputation: 32770
The standard filter do not accept regular expressions (despite the fact the last field is even called the "expression" field).
In theory a "equals" or "begins with" filter should be okay (and you do not need to escape the expression), but the surefire way is to use a custom filter, select exclude, IP address as field name and enter a regular expression.
Note that if you use IP anonymization you need to exclude a whole block of IP addresses. IP anonymization was largely a response to European privacy laws which prohibit Google from storing IP addresses in conjunction with web analytics data. IP anonymization cuts of the last three digits (last 80bytes respectively in IPv6 addresses) of the address (which leaves enough info for geo localization but not enough to identify a person).
As data storage happens before the data goes to processing, by the time data arrives at the filters the IP has already been truncated. So the full IP is not available in the filters for comparison.
The solution would be to use a custom filter as describes below with a wildcard for the last three digits, i.e.
123\.123\.123\.*
Of course this will block out a lot more addresses than you want, but I don't think there's a way around it (unless you use some other way of filtering your visits, like setting a custom dimension in your browser and filter by that, install the opt-out-plugin or set a first party cookie in the format ga-disable-UA-XXXXXXXX-X
which has the same effect as the plugin).
This is also relevant if you send data using the Measurement Protocol and override the ip as the uip parameter will always be anonymized even if you pass in the full address.
Upvotes: 3