Tracking Events (API)

You can use this REST API to send events from back-end.

Endpoint:

https://track.flashyapp.com/events/track

We suggest to use our JS since we track more information about the visitor.

UpdateCart

JSON
JSON
{
"key": "__API_KEY__",
"event": "UpdateCart",
"body": {
"account_id": {{ACCOUNT_ID}},
"email": "[email protected]",
"content_ids": ["product_id"],
"value": 100,
"currency": "USD"
}
}

Purchase

JSON
JSON
{
"key": "__API_KEY__",
"event": "Purchase",
"body": {
"account_id": {{ACCOUNT_ID}},
"order_id": "123456ASD",
"email": "[email protected]",
"content_ids": ["product_ids", "products_1"],
"value": 100,
"currency": "USD"
}
}

Purchase Update

JSON
JSON
{
"key": "__API_KEY__",
"event": "Purchase",
"body": {
'status': 'PENDING',
'order_id': '__ORDER_ID__',
'content_ids': ["product_id"], // Optional
'value': 100, // Optional
'currency': 'USD' // Optional
}
}

Custom Event

JSON
JSON
{
"key": "__API_KEY__",
"event": "CustomEvent",
"body": {
"account_id": {{ACCOUNT_ID}},
"email": "[email protected]",
"event_name": "SomeAction"
}
}

Contextual Data

Many times we want to track more information into an event that has happened and use that information within the customer's journey and the messages we send.

The way to do this is to add the following code to the event:

JSON
JSON
{
"key": "__API_KEY__",
"event": "CustomEvent",
"body": {
"account_id": {{ACCOUNT_ID}},
"email": "[email protected]",
"event_name": "SomeAction",
"context": {
"key_1": "can be anything",
"key_2": "helpful information"
}
}
}

In order to use this information in the messages you send you can use: {{context.key_1}}

And we will pull this information from the event.