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.

geolocation_context

Entity
Schema for client geolocation contexts
Schema URIiglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0
Tracker compatibility
Web: Mobile: Tracked 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
PropertyDescription
latitude
number
Required.
longitude
number
Required.
latitudeLongitudeAccuracy
number
Optional.
altitude
number
Optional.
altitudeAccuracy
number
Optional.
bearing
number
Optional.
speed
number
Optional.
timestamp
integer
Optional.

How to track?