Tracker
Endpoints for tracking custom events
This endpoint can be used in order to track events like impressions and clicks. However this is generic enough and can be used for tracking any custom events like user registrations, logins and transactions.
Tracking body
The body of the request must contain the event type an optional user_id and the actual tracking data.
datacan be an arbitraryjsonobject containing the event info. For eachclick/impressionevent you need to include these two fields apart from the needed fields for each type:page: The page in the website/app the widget is located, e.g./home,/liveetc.location: The location of the widget, e.g.highlights:recommended. Make sure to follow the convention ofwidget:typefor this field.
event_typedescribes the type of the event, e.g.clicks:event,clicks:outcome,statistics:add_bet. Notice that it must be one of the supported event types.user_idmust be provided if the tracking event corresponds to a specific user, otherwise it should benull.
Notice that any other additional data needed for a specific integration can be included in the data field of the request as long as the required fields are provided.
Frontend vs Backend requests
In order to be able to collect meaningful analytics we want to know the origin and the device from which the request originated.
For a frontend integration these properties are automatically added by the browser, so you don't need to enhance data with these fields.
{
"user_id": "123",
"event_type": "clicks:event",
"data": {
"event_id": "1018561959",
"position": 0,
"location": "widget:recommended",
"page": "/home"
}
}For backend requests since these headers are missing, it is suggested to specify the channel and the brand, in the data body.
{
"user_id": "123",
"event_type": "clicks:event",
"data": {
"event_id": "1018561959",
"position": 0,
"location": "widget:recommended",
"page": "/home",
"brand": "https://website.com",
"channel": "android"
}
}Where
channel: the channel the backend request is originated from, e.g.desktop,mac,iosbrand: a url or a brand name.
Custom client header, the value should be the name of the group the user belongs to
Authentication method to be used, supported values [vaix, iam]. Defaults to vaix
A tracker event object
The tracking event info
The type of the event
The user identifier
No Content
Bad Request
Unauthorized
Forbidden
Not Acceptable
Request Entity Too Large
Unprocessable Entity
Too Early
Internal Server Error
POST /api/tracker/events HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Content-Type: application/json
Accept: */*
Content-Length: 59
{
"data": {},
"event_type": "add:casino_game",
"user_id": "text"
}No content
Was this helpful?