Skip to main content

Using geolocation features

About geolocation#

Using Talon.One, it is possible to create campaigns that only trigger if you customer is in a specific location.

To do this, you can:

  • Use the existing CurrentLocation attribute or,
  • Define a new location attribute, and send a value for this attribute at runtime in a customer session. This location attribute can then be used in the Rule Builder to create location-based conditions.

Create a session attribute for location#

The rest of this tutorial assumes you have created a custom attribute for the session entity of type location:


For more information on creating custom attributes, see the corresponding Help Center Article

This attribute will be used to pass the location data at runtime to Talon.One.

Passing location data in the Integration API#

Location attributes can be sent in 3 different data formats: GeoJson, GeoJsonBase64 and Point. For the purpose of communicating an end-users location to Talon. One, the point-type is the easiest to implement. The Point format consists of a single string that contains the x and y coordinates, in a comma separated string:

CurrentLocation: {  format: "point",  object: "13.391799, 52.498605"}

The attribute can be sent in a customer session as follows:

curl \-X PUT \-d '{  "profileId": "35",  "attributes": {    "CurrentLocation": {      "format": "point",      "object": "13.391799, 52.498605"    }  }}'

Any campaigns that use location aware conditions can then be evaluated using this attribute: