Tracking Events List
Events keep track of your contacts' activity and can start automations. Send them with a POST request to /event (or /event/offline for offline sources).
We suggest using our predefined events where one exists — and our JS snippet where possible, since it tracks more information about the visitor. There is always the option of a custom event for anything else.
ViewContent
{
"event": "ViewContent",
"body": {
"email": "contact@company.com",
"content_ids": ["38", "789"]
}
}
UpdateCart
Use this event to update the entire cart content of a contact. There is no quantity per product — just an array of products.
{
"event": "UpdateCart",
"body": {
"email": "customer@email.com",
"content_ids": ["product_id_1", "product_id_2"],
"value": 100,
"currency": "USD"
}
}
Purchase
The order_id must be unique.
{
"event": "Purchase",
"body": {
"order_id": "123456ASD",
"email": "customer@email.com",
"content_ids": ["product_ids", "products_1"],
"value": 100,
"currency": "USD"
}
}
PurchaseUpdated
Update the status of an existing order. content_ids, value and currency are optional.
{
"event": "PurchaseUpdated",
"body": {
"status": "PENDING",
"email": "demo@flashyapp.com",
"order_id": "__ORDER_ID__",
"content_ids": ["product_id"],
"value": 100,
"currency": "USD"
}
}
Custom events
{
"event": "CustomEvent",
"body": {
"email": "customer@email.com",
"event_name": "SomeAction"
}
}
Adding extra information with context
Often you want to attach more information to an event and use it within the customer's journey and the messages you send. Add a context object to the event:
{
"event": "CustomEvent",
"body": {
"email": "customer@email.com",
"event_name": "SomeAction",
"context": {
"key_1": "can be anything",
"key_2": "helpful information"
}
}
}
To use this information in the messages you send, reference it as:
{{context.key_1}}
and we will pull it from the event.
Offline events
For offline sources use POST /event/offline: we first look the contact up by email, and fall back to phone — send both keys you have for the best match. Available on the Master plan and above.
{
"event": "Purchase",
"body": {
"order_id": "159",
"value": 150,
"currency": "USD",
"phone": "972526845400",
"email": "contact@company.com",
"content_ids": ["38", "789"],
"channel": "offline",
"branch": "San Francisco"
}
}