Why IP Geolocation Can Go Wrong: Causes and Fixes

Last Updated Feb 11, 2022
Emma Jagger

Engineer, maker, Google alumna, CMU grad

IP geolocation is a compelling technology that has the potential to be extremely helpful for an e-commerce page or other websites, simply by sourcing a user’s IP address location. This can span everything from preventing fraud to offering more relevant content experiences for customers.

But with the best will in the world, nothing is perfect and there are a whole host of reasons why IP addresses, whether sourced from API, database, or lookup might be incorrect.

Don't reinvent the wheel.
Abstract's APIs are production-ready now.

Abstract's suite of API's are built to save you time. You don't need to be an expert in email validation, IP geolocation, etc. Just focus on writing code that's actually valuable for your app or business, and we'll handle the rest.

Get started for free

General IP geolocation accuracy

One important point to bear in mind is that of scale. There are approximately 4.3 billion IPv4 internet addresses in use in different physical locations across the world with many different ISPs (Internet Service Providers) managing them all. The law of averages alone should tell us that something is bound to go wrong when there are this many factors.

Also, IPv4 is hardly a modern technology. It’s an early internet technology that was first deployed on SATNET (Atlantic Packet Satellite Network) in 1982 and ARPANET (Advanced

Research Projects Agency Network) in 1983. Put simply, it predates the public internet.

Map image courtesy of Pixabay

 As a result, IP geolocation accuracy is estimated to be:

  • Country: 95% to 99%
  • Region (State): 55% to 80%
  • City: 50% to 75%

As you can see, it starts to decline because it’s relatively easy when the IP lookup is attempting to determine an area as large as a country. However, the more granular the data becomes, the harder it becomes to ensure that it’s accurate.

As a result, it’s important to understand that even the best IP geolocation services, despite their many strengths for websites, are innately prone to a margin of error. This means that it can’t be viewed as an exact location finder and that for some sites or services, it can be important to give the user the option to confirm their address.

Quality of IP database provider 

There’s an old saying in the digital era: garbage in, garbage out. While all IP databases get their data from ARIN (American Registry for Internet Numbers) it can still be wrong. While updates to ARIN can be submitted, they don’t register in ARIN immediately. Therefore, there’s a short window during which data available from ARIN post-update may be inaccurate. It’s possible to submit updates to ARIN on an ongoing basis, but if this is only done a limited number of times over a specific time period, then the data may be inaccurate.

Also, individual ISPs may not be current themselves. If an ISP releases a block of unwanted IP addresses or acquires more, then this can lead to inaccuracy.

In such a connected world with so many interdependent systems, we shouldn’t be surprised to learn that sourcing a user’s physical location to the right city can be a challenge. However, the cost of deploying more accurate technologies such as GPS may be noticeably greater. As a result, IP geolocation may prove to be the more attractive option.

The Fix

You can assess the exactness of individual geolocation services for your operational needs by using a trial account to test it directly. If location data is important for your operations, assess how often an ISP updates their free databases versus their paid databases. If there’s a difference between the data and location data is that important for you, then consider moving to a paid option where more frequent updates are taking place.

On the user side of the equation, give the user the option to correct the location you’ve detected. If there’s value for them in terms of enabling location sensitive services, then there’s a good chance that they’ll be prepared to update the location.

Downloaded IP databases

Typically, there are two methods for carrying out IP Geolocation: databases and APIs. The advantage of third party databases providing IP addresses from a local server is that it won’t consume any additional bandwidth to produce the data. However, the big disadvantage is that it means that you’re going to be solely responsible for updating the database. So, this will need to be a responsibility that’s allocated to someone in the IT team with an update schedule to ensure that the database remains up to date on an ongoing basis. This inevitably means that there will be a delay between the point in time at which an update becomes available and the time at which it gets rolled out for your service.

The advantage of an API is that this potential complication is abstracted away. As soon as the data is updated by the vendor, it’ll automatically become usable on your systems. So, no delays and no additional management is needed.

Systemic problems

As mentioned above, IP addresses are a complex system and have inherent disadvantages alongside their advantages.

Connectivity and mobility image courtesy of Pixabay

One clear example of this becomes clear using a mobile device such as a smartphone. As people naturally go about their day such as commuting or going shopping, they’re constantly moving to a different location and they’ll be ‘passed’ from one cell phone tower to the next. This means that a user’s mobile phone location will be constantly changing and can mean that IP Geolocation might be accurate from 50 KM to 100 KM. One study from September 2021 found that 75% of IPv4 internet addresses are assigned for less than a day.

Also, while the detected phone network provider may be correct, the location that gets detected might be the office for the network provider rather than the user’s location. In the UK, a group of smaller countries, this can result in errors that can, if rarely, get the country wrong.

Individual users of an internet service provider, especially home users, typically have a dynamic IP address on the ISP’s network. This means that each time they connect to the network, such as after a power outage or router reboot to try to resolve connectivity issues, they’ll be assigned a different IP address. So IP lookup will provide a different address each time even though the user or users, their location and the sites they visit remain the same. So, while a corporation or organization of some kind is likely to be provided with static IP addresses by their ISP, it’s not safe to assume that the predictability of behavior resulting from locked IP addresses in such circumstances is common.

Connectivity image courtesy of Pixabay

Home internet with apartments or multiple people in the same residence or property can share IP addresses. Venue wireless services can also mean that the same IP address can be used by hundreds or thousands of users on different devices connecting to wifi located at the same physical location. So, this makes it extremely difficult to determine which user is which. With different parties coming and going, IP address isn’t an infallible way of detecting the physical location of individual users.

Finally, be aware that a service such as VPN (Virtual Private Network) which have legitimate uses (ensuring secure connections by employees to company systems) can also be used to obfuscate location data for fraud. Many services do offer the capability to detect connections using such tools, but these can be ‘gated’ at higher pricing levels.

Conclusion

While IP Geolocation offers a wide range of options, it isn’t safe to view it as a ‘fire and forget’ technology guaranteed to provide a user’s location. Instead, like most technologies, it requires ongoing management to ensure its viability on an ongoing basis.

Also, the more granular the data required, the more likely it is that IP address data more accurate than city level is going to be less than 50%. With such a complex system spanning ARIN, internet service providers, vendors, websites, VPN, and your deployment, then it’s inevitable that errors will exist. Take every reasonable step to mitigate this, but from the beginning of the selection process be sure to manage stakeholder expectations.

Geolocate IP addresses with high accuracy using Abstract's API.

Get started for free
Geolocate IP addresses with high accuracy using Abstract's API.
Get started