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?