Fastly provides a variety of geolocation data, allowing the originating geographical location of a request to be determined.
IMPORTANT: GeoIP information, including data streamed by our log streaming service, is intended to be used only in connection with your Fastly services. Use of GeoIP data for other purposes may require permission from Digital Element, our data supplier. For more information see our overview of using IP-based geolocation and intelligence.
client.geo. namespace contains the geolocation data we recommend for most use cases. The
client.as. namespace offers information about the client's Autonomous System (AS), which is often the end user's Internet Service Provider.
Legacy GeoIP dataset Learn more...
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.
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 (client.as.name == "?", client.as.name, "");