# How websites know where visitors are, and how accurate it is

> IP location gets the country right almost every time and the city wrong often. How geolocation works, where it fails, and why we read it at the CDN.

Guides · Published 2026-11-16

Most websites find a visitor's location from their IP address: the number their internet connection uses. It gets the country right almost every time, the state or region often, and the city much less reliably. VPNs, work networks and some phone networks can place people in the wrong country altogether. So target by country, use the state where it matters, and expect the city to be wrong for many visitors.

## How IP location works

Every device online reaches websites through an IP address, and blocks of addresses belong to networks: internet providers, phone companies, businesses. Location providers keep databases that map those blocks to places, built from registry records and their own measurements. A website looks up the visitor's address in such a database.

Some content delivery networks, which sit in front of many websites, do this lookup themselves and pass the visitor's country and region along with each request. GeoEngage reads the location that way, for reasons explained below.

## How accurate it is

The country is the reliable part. City-level results are much weaker: in MaxMind's own [accuracy comparison](https://www.maxmind.com/en/geoip-accuracy-comparison), when we checked, 64% of addresses in Australia and 56% in Austria were placed within 50 km of the right city.

| Level | How reliable | Good for |
| --- | --- | --- |
| Country | Right for almost every visitor | Delivery terms, legal notices, language |
| State or region | Usually right in large countries | Regional offers, where a miss isn't costly |
| City | Often tens of kilometres off | Avoid for anything that matters |

## Where it goes wrong

- **VPNs** place visitors where the VPN's server is, often another country.
- **Work networks** can route a whole company's traffic through one office, sometimes abroad.
- **Phone networks** may route traffic through a city far from the visitor.
- **Privacy relays** such as iCloud Private Relay keep visitors in their general region, MaxMind [says](https://www.maxmind.com/en/geoip/ip-geolocation-accuracy), but not their exact city.
- **Some addresses can't be placed at all.**

## What about the browser's location?

A browser can share a precise location from GPS or Wi-Fi, but only after asking the visitor. The request interrupts the visit, and many people say no. For changing a page, IP location is usually enough, and asks nothing of the visitor.

## Why GeoEngage reads location at the CDN

GeoEngage needs every visitor's country, on every page view, for every customer's site. The obvious way is a free IP location database or API. When we read their licences, in September 2026, most free options didn't allow what we needed: commercial use, with results shown to our customers.

- **[ip-api.com](https://ip-api.com/)**'s free plan is "strictly limited for a non-commercial purpose".
- **[MaxMind GeoLite2](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data)**, the best-known free database, is licensed for your own internal business purposes, which doesn't fit a product that shows results to its customers.
- **[DB-IP Lite](https://db-ip.com/db/lite.php)** allows commercial use with attribution, under a Creative Commons licence, updated monthly.
- **[IPinfo Lite](https://ipinfo.io/lite)** allows commercial use, but gives the country and the network, not the region.

Paid databases fit, at a price, plus the work of keeping a large file up to date on every server. So we read the location from the CDN in front of our servers instead. It already works out where each request comes from, and passes the country, region and timezone along with it:

- **No third-party lookup.** No extra call to another company, and no licence question.
- **Nearby.** The location is answered close to the visitor, alongside the widget's other requests.
- **One answer everywhere.** The location your rules use is the location your reports show.

Accuracy has the same limits as any IP location. If you build your own lookup, read the licence for your use: some free databases fit an internal dashboard and not a product, and some need an attribution line.

## What this means for your rules

- **Target the country.** It's the level that's right for almost everyone.
- **Use the state where it matters,** with a fallback for visitors whose state is unknown ([When a value is unknown](https://geoengage.app/docs/rules/dynamic-text#when-a-value-is-unknown)).
- **Don't target the city.** GeoEngage's rule builder leaves city out for this reason.
- **Keep messages harmless when wrong.** A visitor on a VPN who reads another country's delivery terms isn't harmed if checkout charges the right price. Be careful with redirects: suggest the other country's page with a banner rather than sending visitors there automatically, so a traveller isn't trapped.

When GeoEngage can't place a visitor, location rules don't run for them: it never guesses a country ([Location conditions](https://geoengage.app/docs/rules/conditions#location)).

## Common questions

### Can a visitor fake their country?

With a VPN, yes. That's why location should decide what someone reads, not what they can buy.

### Does looking up the location slow the page?

In GeoEngage the lookup runs at the same time as loading your rules, and the CDN answers it close to the visitor, with no outside location service in between.

### Do you send visitors' addresses to a location company?

No. The location comes from the CDN that already carries the request.

---

Source: https://geoengage.app/blog/how-website-geolocation-works
