curl -X POST https://api2.ecomailapp.cz/tracker/events \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": {
"email": "john@example.com",
"category": "shopping",
"action": "product_viewed",
"label": "Nike Air Max 90",
"property": "nike-air-max-90",
"value": {
"product_id": 12345,
"price": 139.99,
"currency": "EUR",
"variant": "Black/White",
"url": "https://example.com/products/nike-air-max-90"
}
}
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/tracker/events');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'event' => [
'email' => 'john@example.com',
'category' => 'shopping',
'action' => 'product_viewed',
'label' => 'Nike Air Max 90',
'property' => 'nike-air-max-90',
'value' => [
'product_id' => 12345,
'price' => 139.99,
'currency' => 'EUR',
'variant' => 'Black/White',
'url' => 'https://example.com/products/nike-air-max-90',
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 1234,
"email": "john@example.com",
"category": "shopping",
"action": "product_viewed",
"label": "Nike Air Max 90",
"property": "nike-air-max-90",
"value": "{\"product_id\":12345,\"price\":139.99,\"currency\":\"EUR\",\"variant\":\"Black/White\",\"url\":\"https://example.com/products/nike-air-max-90\"}"
}
Tracker events
Create an event
Track a custom event for a subscriber. Supplements the JavaScript tracker.
POST
/
tracker
/
events
curl -X POST https://api2.ecomailapp.cz/tracker/events \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": {
"email": "john@example.com",
"category": "shopping",
"action": "product_viewed",
"label": "Nike Air Max 90",
"property": "nike-air-max-90",
"value": {
"product_id": 12345,
"price": 139.99,
"currency": "EUR",
"variant": "Black/White",
"url": "https://example.com/products/nike-air-max-90"
}
}
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/tracker/events');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'event' => [
'email' => 'john@example.com',
'category' => 'shopping',
'action' => 'product_viewed',
'label' => 'Nike Air Max 90',
'property' => 'nike-air-max-90',
'value' => [
'product_id' => 12345,
'price' => 139.99,
'currency' => 'EUR',
'variant' => 'Black/White',
'url' => 'https://example.com/products/nike-air-max-90',
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 1234,
"email": "john@example.com",
"category": "shopping",
"action": "product_viewed",
"label": "Nike Air Max 90",
"property": "nike-air-max-90",
"value": "{\"product_id\":12345,\"price\":139.99,\"currency\":\"EUR\",\"variant\":\"Black/White\",\"url\":\"https://example.com/products/nike-air-max-90\"}"
}
Only the
email field is required. All other fields (category, action, label, property, value) are optional — include only what makes sense for your use case.
The value field accepts a plain string, a JSON-encoded string, or a JSON object/array. If you pass an object or array, we will automatically JSON-encode it on our side.
category, action, label and property are each capped in length. If you send a longer value, it is automatically truncated to fit — the request still succeeds and the response reflects the truncated value. email and value work differently: exceeding their limit fails the whole request with a 422 validation error instead of truncating.Length caps on category, action, label and property are measured in bytes of the UTF-8-encoded value, not characters — accented characters, emoji, and other multi-byte characters count as more than one byte each and may be cut off earlier than the byte count suggests.object
required
Event details.
Show event properties
Show event properties
string
required
Subscriber’s email address. The subscriber must already exist in your contact list. Maximum length is 150 characters — longer values are rejected with a
422 error, not truncated.string
Event category (e.g.
"shopping", "engagement", "support"). Maximum length is 255 bytes; longer values are truncated.string
Event action (e.g.
"product_viewed", "form_submitted", "review_left"). Maximum length is 255 bytes; longer values are truncated.string
Event label — a human-readable name or identifier (e.g. a product name, page title). Maximum length is 255 bytes; longer values are truncated.
string
Event property — a custom key or identifier (e.g. a product SKU, category slug). Maximum length is 300 bytes; longer values are truncated.
string | object | array
Event value. Can be a plain string, a JSON-encoded string, or a JSON object/array (objects and arrays will be JSON-encoded automatically on our side). Maximum length is 20,000 characters (after JSON encoding, if applicable) — longer values are rejected with a
422 error, not truncated.curl -X POST https://api2.ecomailapp.cz/tracker/events \
-H "key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": {
"email": "john@example.com",
"category": "shopping",
"action": "product_viewed",
"label": "Nike Air Max 90",
"property": "nike-air-max-90",
"value": {
"product_id": 12345,
"price": 139.99,
"currency": "EUR",
"variant": "Black/White",
"url": "https://example.com/products/nike-air-max-90"
}
}
}'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api2.ecomailapp.cz/tracker/events');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'event' => [
'email' => 'john@example.com',
'category' => 'shopping',
'action' => 'product_viewed',
'label' => 'Nike Air Max 90',
'property' => 'nike-air-max-90',
'value' => [
'product_id' => 12345,
'price' => 139.99,
'currency' => 'EUR',
'variant' => 'Black/White',
'url' => 'https://example.com/products/nike-air-max-90',
],
],
]));
$response = curl_exec($ch);
curl_close($ch);
{
"id": 1234,
"email": "john@example.com",
"category": "shopping",
"action": "product_viewed",
"label": "Nike Air Max 90",
"property": "nike-air-max-90",
"value": "{\"product_id\":12345,\"price\":139.99,\"currency\":\"EUR\",\"variant\":\"Black/White\",\"url\":\"https://example.com/products/nike-air-max-90\"}"
}