Skip to main content

Geolocation

There are two options to attach geolocation information to Snowplow events:

  1. Based on the user IP address in enrichments.
  2. Using on device geolocation inside the Web or mobile app.

Geolocation based on the IP addressโ€‹

Geolocation information can be automatically extracted from the IP address of the HTTP request to the collector. This is done during enrichment using the IP Lookup Enrichment.

You can see the information added to events as atomic event properties in this table.

Geolocation context entity tracked in appsโ€‹

Geolocation information can also be fetched in the app using our trackers and attached to events as a context entity. This is often more accurate than the IP-based geolocation but requires permission from the user.

Context entity: geolocation_context

Schema for client geolocation contexts

Schema URI:iglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0

WebMobileTracked automatically
โœ…โœ…โœ…
๐Ÿ‘€ Example
{
"latitude": 30.04335623,
"longitude": 67.59633102,
"latitude_longitude_accuracy": -24902753.22,
"altitude": -19459.88,
"altitude_accuracy": -29970651.08,
"bearing": 21055653.32,
"speed": -7127794.98
}
๐Ÿ“ƒ Schema properties definition
PropertyTypeDescriptionRequired?
latitude"number"โœ…
longitude"number"โœ…
latitudeLongitudeAccuracy["number","null"]โŒ
altitude["number","null"]โŒ
altitudeAccuracy["number","null"]โŒ
bearing["number","null"]โŒ
speed["number","null"]โŒ
timestamp["integer","null"]โŒ

How to track?โ€‹