Fastly provides a variety of geolocation data, allowing the originating geographical location of a request to be determined.

The client.geo. namespace contains the geolocation data we recommend for most use cases. The namespace offers information about the client's Autonomous System (AS), which is often the end user's Internet Service Provider.

Legacy GeoIP dataset Expand

IP address used for lookup

The IP address used for the geolocation lookup is automatically populated from client.ip by default, but may be overridden explicitly by setting client.geo.ip_override.

Lossy formats

Geographic variables representing names are available in several formats. Note in particular the *.ascii variables are lossy. These variables have diacritics removed and are normalized to lower case spellings. These *.ascii variables are intended for ease of use as a symbolic string in code (for example, to perform some different action depending on the city name), and are generally inappropriate for presenting to users due to their simplified content.

Absent data

The data is updated periodically, as IP allocations change and various amendments are made. Some variables may be absent for the current data at any given time.

For STRING types, the special value ? is used to indicate absent data. These may be normalized to VCL empty strings using the if ternary operator:

if ( == "?",, "");

In general values of type STRING in VCL may be not set, but this should never occur for the Geolocation variables.