Back
Question
Asked

Is it possible to hide the user's IP address from a tracking script?

For #simpleanalytics I want to hide the user's IP address. I don't want to get the real one anyway. But having a HTTP handshake is I think not possible. Maybe a proxy? But does that work for a script in the browser? Any ideas?


If the user requests a resource from your server you need their IP address in order to respond to the request. So no, I don't think it's possible.

You might be able to put a CDN like Cloudflare between you and the user, and perhaps you can configure the CDN such that it doesn't forward the user's IP address, but then they would still get the IP address. That's probably not what you want either.

The next best thing might be to just scrub your server logs of IP addresses.

I don't want to give that data to CloudFlare indeed. I will not record the IP's but I can't prove that to my customers. But yeah, I don't know how (if indeed possible).

I know this is an old question, but just thought I'd add a simple solution which would be putting a load balancer (e.g. nginx) in front of your API and disabling logs for nginx (or writing to /dev/null).