A technical and legal question - what's the best rails gem to auto-detect location of a web visitor via e.g. IP? Down to granularity of state.
And is this an illegal privacy breach? Why do some sites auto-detect location and others ask for manual zip code input?
Thanks in advance!
You'll need some sort of IP-to-location translation database, like this one:
http://www.maxmind.com/app/ip-location
[Update: free version is here: http://www.maxmind.com/app/geolitecity]
The reason some auto-detect and others don't is a question of reliability. You can't guarantee the IP you're seeing is the actual end users IP (proxies/VPNs/etc cause problems) so while it's fine for general use, it's not practical if you're doing something for example with billing or calculating shipping costs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With