3rd Dec 2019

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 make this possible, you can either 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:

LocationAttribute

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 https://example.talon.one/v1/customer_sessions/C156904 \
-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:

LocationCondition

Still need help? Get in touch!
Last updated on 3rd Dec 2019

Was this article helpful?

Thank you! You have already voted

If you’d like a member of our support team to respond to you, please send a note to support@talon.one