Use this API to send custom events to Heap server-side. We recommend using this for events that need to exactly match your backend, such as completed order transaction info, or events that are not available for Heap to capture on the client-side.
NOTE: It is required that you use either the identity
or user_id
param, but not both.
Limitations
- Requests are limited to 30 requests per 30 seconds per identity per app_id.
- It is required that you use either the identity or user_id param, but not both.
- Please note:
fetch
,jQuery
, andXMLHttpRequest
options are not currently supported.
If your Heap data is in an EU datacenter, the correct endpoint is:
https://c.eu.heap-api.com/api/track (NOT heapanalytics.com)
Array property values
The properties
object can contain array values. Upon ingestion, array values are converted to strings with a ||
delimiter. In the example below, the array is stored as the string"vanilla||chocolate||strawberry"
. The converted string value can be up to 1024 characters, any characters beyond this limit will be truncated.
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"app_id": "11",
"identity": "[email protected]",
"event": "Send Transactional Email",
"timestamp": "2017-03-10T22:21:56+00:00",
"properties": {
"subject": "Welcome to My App!",
"variation": "A",
"flavors": ["vanilla", "chocolate", "strawberry"]
}
}' \
https://heapanalytics.com/api/track