filtergoogle-analyticsuniversal-analytics

Does Google Universal Analytics support x-forwarded-for header for ip filters?


Does Google Universal Analytics support x-forwarded-for header for ip filters?

I am trying to filter out internal ips but it doesn't seem to work. The application is sitting behind a proxy, so the client's ip is in the x-forwarded header.


Solution

  • According to this question the measurement protocol (which forms the base for all versions of the Google Analytics tracking) ignores x-forwarded ip headers.

    This is solved in serverside implementations as Google has added a parameter uip (must be a valid IP, will always be anonymized by setting the last three numbers to 000) to the measurement protocol to send a clients ip. I don't know terribly much about proxy servers, but it might be possible to stitch the parameter into the request instead of using a header field.