Tracking Events (API)
You can use this REST API to send events from back-end.
Endpoint:
1
https://track.flashyapp.com/events/track
Copied!
We suggest to use our JS since we track more information about the visitor.

UpdateCart

JSON
1
{
2
"key": "__API_KEY__",
3
"event": "UpdateCart",
4
"body": {
5
"account_id": {{ACCOUNT_ID}},
6
"email": "[email protected]",
7
"content_ids": ["product_id"],
8
"value": 100,
9
"currency": "USD"
10
}
11
}
Copied!

Purchase

JSON
1
{
2
"key": "__API_KEY__",
3
"event": "Purchase",
4
"body": {
5
"account_id": {{ACCOUNT_ID}},
6
"order_id": "123456ASD",
7
"email": "[email protected]",
8
"content_ids": ["product_ids", "products_1"],
9
"value": 100,
10
"currency": "USD"
11
}
12
}
Copied!

Purchase Update

JSON
1
{
2
"key": "__API_KEY__",
3
"event": "Purchase",
4
"body": {
5
'status': 'PENDING',
6
'order_id': '__ORDER_ID__',
7
'content_ids': ["product_id"], // Optional
8
'value': 100, // Optional
9
'currency': 'USD' // Optional
10
}
11
}
Copied!

Custom Event

JSON
1
{
2
"key": "__API_KEY__",
3
"event": "CustomEvent",
4
"body": {
5
"account_id": {{ACCOUNT_ID}},
6
"email": "[email protected]",
7
"event_name": "SomeAction"
8
}
9
}
Copied!

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
1
{
2
"key": "__API_KEY__",
3
"event": "CustomEvent",
4
"body": {
5
"account_id": {{ACCOUNT_ID}},
6
"email": "[email protected]",
7
"event_name": "SomeAction",
8
"context": {
9
"key_1": "can be anything",
10
"key_2": "helpful information"
11
}
12
}
13
}
Copied!
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.
Last modified 5mo ago