Track custom events

Legacy Tracker Documentation

For the legacy tracker doc, check our guide here.

This endpoint captures events and additional information about them. A cURL request is shown below:

1curl --request POST \
2 --url https://in-automate.brevo.com/api/v2/trackEvent \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --header 'ma-key: YOUR_MA_KEY' \
6 --data '
7{
8 "email": "example@brevo.com",
9 "event": "cart_updated",
10 "properties": {
11 "additionalProp": "additional property"
12 },
13 "eventdata": {
14 "data": {
15 "added_product": [
16 {
17 "currency": "EUR",
18 "name": "Wrist watch",
19 "type": "accessories",
20 "price": "50.00"
21 }
22 ]
23 }
24 }
25}
26'

Use any value for the event field and pass any key-value in properties. Do not use the reserved keys email or event inside the properties object. The attributes used to track events are:

AttributeDatatypeDescriptionValue
emailStringEmail used to identify the userjohn.doe@email.com
eventStringEvent to track”item_deleted”
propertiesObjectCustom fields. These user properties populate your contact database.See example above
eventdataObjectData you want to pass about the eventSee example above

Response

Response codeMessageDescription
204Event has been tracked successfullyNo content in the JSON response — the event has been tracked.
400Bad requestReturned for out_of_rangeModel, invalid_parameter, or missingParameter errors.