Track Events API for Recommendations
Send product interaction events directly to Intempt's recommendation engine via the Track API.
Track Events API for Recommendations
The Track Events API lets you send product interaction events directly to Intempt's recommendation engine. These events power recommendation feeds including Recently Viewed, Recently Added to Cart, and purchase-based recommendations.
Endpoint
POST https://api.intempt.com/v1/{orgName}/projects/{projName}/sources/{sourceId}/track?apiKey={apiKey}| Parameter | Description |
|---|---|
orgName | Your organization name |
projName | Your project name |
sourceId | The source identifier |
apiKey | The API key of that source. Required on every request, passed as a query parameter. |
Authentication
The track endpoint authenticates with the source's own API key, sent as the apiKey query parameter. A request without it returns 401. Use the apiKey that Intempt generated when you created the source (see Server-Side API Integration). Every example below is sent to the endpoint above, with ?apiKey={apiKey} on the URL.
Supported Event Names
The name field must match one of these four values (matching is case-insensitive):
| Event Name | Powers |
|---|---|
Product viewed | Recently Viewed feed, view-based models |
Added to cart | Recently Added to Cart feed, cart-based logic |
Removed from cart | Cart-based feed accuracy, cart state consistency |
Product ordered | Purchase-based models, post-purchase recommendations |
Request Body
{
"track": [
{
"name": "EVENT_NAME",
"payload": [
{
"eventId": "unique-event-id",
"userId": "user-identifier",
"data": {
"productId": "product-identifier"
}
}
]
}
]
}Field Reference
| Field | Required | Description |
|---|---|---|
name | Yes | Event name — must exactly match one of the four supported names |
eventId | Yes | Unique identifier per event — used for deduplication |
userId | Yes* | User identifier. At least one identity field required. |
anotherUserId | No | Secondary user ID for identity linking |
accountId | No | Account/organization identifier |
data.productId | Yes | Product identifier — mandatory for all recommendation events |
* At least one of userId, anotherUserId, or accountId must be provided.
data.productIdis required. Events withoutproductIdwill not power recommendation feeds. It cannot be renamed or mapped from another field name.
Examples
Product Viewed
{
"track": [
{
"name": "Product viewed",
"payload": [
{
"eventId": "evt_view_001",
"userId": "user_123",
"data": {
"productId": "SKU_987"
}
}
]
}
]
}Added to Cart
{
"track": [
{
"name": "Added to cart",
"payload": [
{
"eventId": "evt_cart_001",
"userId": "user_123",
"data": {
"productId": "SKU_987"
}
}
]
}
]
}Removed from Cart
{
"track": [
{
"name": "Removed from cart",
"payload": [
{
"eventId": "evt_remove_001",
"userId": "user_123",
"data": {
"productId": "SKU_987"
}
}
]
}
]
}Product Ordered
{
"track": [
{
"name": "Product ordered",
"payload": [
{
"eventId": "evt_order_001",
"userId": "user_123",
"data": {
"productId": "SKU_987"
}
}
]
}
]
}Notes
- Each
eventIdmust be unique across all submissions — duplicates are deduplicated productIdmust live inside thedataobject — it cannot be at the root level- Use Recommendation Events Mapping if you want to map existing custom events without changing your tracking code
