Using Geolocation Features
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:
Point. For the purpose of communicating an end-users location to Talon. One, the point-type is the easiest to implement.
Point format consists of a single string that contains the x and y coordinates, in a comma separated string:
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 \
"object": "13.391799, 52.498605"
Any campaigns that use location aware conditions can then be evaluated using this attribute: