Skip to main content

Geolocation and timezone tracking

Snowplow provides several ways to capture location and timezone information:

  • IP-based geolocation: the IP Lookup enrichment adds location data to the geo_ atomic event properties based on the user's IP address.
  • Device geolocation: client-side trackers can access GPS coordinates from the device and attach them as an entity. This requires user permission but provides more accurate location data.
  • Timezone: most trackers can capture the device timezone and add it to the os_timezone atomic event property.

Location atomic event properties

The IP Lookup enrichment populates the geo_ atomic event properties, based on the IP address of the HTTP request to the event Collector.

Timezone atomic event property

Some Snowplow trackers can populate the os_timezone atomic event field based on the device timezone.

Depending on the tracker, you may need to configure a plugin, set configuration on tracker initialization, or use the tracker Subject class. This table shows the support for timezone tracking across the main Snowplow tracker SDKs:

TrackerSupportedSince version
Web3.0.0
iOS0.1.0
Android0.1.0
React Native0.1.0
Flutter0.1.0
Roku0.1.0
Node.js0.8.0
Golang0.1.0
.NET0.1.0
Java0.4.0
Python0.4.0
Scala0.1.0
Ruby0.3.0
Rust0.1.0
PHP0.1.0
C++0.1.0
Unity0.1.0
Lua
Google Tag Manager

Geolocation entity

Some Snowplow trackers can access device geolocation information, e.g. GPS coordinates, and attach it to events as an entity. This requires permission from the user, but is often more accurate than the IP-based geolocation.

This table shows the support for geolocation tracking across the main client-side Snowplow tracker SDKs. The server-side trackers don't include geolocation tracking.

TrackerSupportedSince versionAuto-trackingNotes
Web3.0.0Requires timezone plugin
iOS0.6.0Set in tracker configuration
Android0.6.0Set in tracker configuration
React Native
Flutter0.1.0Set in tracker configuration
Roku
Google Tag Managerv3Integrates with timezone plugin

The React Native tracker did include geolocation entity configuration in earlier versions. We deprecated it in version 4.

geolocation_context

Entity
Schema for client geolocation contexts
Schema URIiglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0
Example
json
{
"latitude": 30.04335623,
"longitude": 67.59633102,
"latitude_longitude_accuracy": -24902753.22,
"altitude": -19459.88,
"altitude_accuracy": -29970651.08,
"bearing": 21055653.32,
"speed": -7127794.98
}
Properties and 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.

On this page

Want to see a custom demo?

Our technical experts are here to help.