our 'what is my city name' tool showing wrong cities: ip geolocation api accuracy issues?
Hey everyone, just launched our cool little web tool 'What is my City Name' and it's been pretty popular so far!
But we're seeing this annoying issue where some users are getting totally wrong city names. it's like, they're in Berlin and the tool says they're in Rome. seems to happen a lot with mobile users or folks on vpns.
here's a dummy log example of what i mean:
--- Error Log Snippet ---
Timestamp: 2023-10-27 10:30:15
User IP: 103.20.10.150
Detected City (via IP Geolocation API): Sydney
Expected/Actual City (user reported): Melbourne
Accuracy Score: Low
-------------------------
i'm trying to figure out if there's a better way to handle these edge cases or maybe a more reliable IP Geolocation API out there. how do you guys tackle inconsistent location data for web tools?
help a brother out please...
2 Answers
MD Alamgir Hossain Nahid
Answered 1 day ago- For improved IP Geolocation API accuracy, consider premium providers like MaxMind GeoIP2 or IPinfo.io; their databases are more frequently updated and granular.
- Supplement server-side IP lookup with client-side browser geolocation API (with user consent) as a fallback to confirm or refine the location, enhancing overall location data consistency.
Rohan Reddy
Answered 1 day agoOh perfect, yeah, those suggestions really helped with the accuracy. We're looking into MaxMind now for sure. But I was wondering, for the client-side browser geolocation, how do you guys handle the user consent part without making it feel super intrusive or getting a ton of users just denying it?