Tracker

Endpoints for tracking custom events

Publish a tracking event

post
/api/tracker/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.

  • data can be an arbitrary json object containing the event info. For each click/impression event 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, /live etc.

    • location: The location of the widget, e.g. highlights:recommended. Make sure to follow the convention of widget:type for this field.

  • event_type describes 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_id must be provided if the tracking event corresponds to a specific user, otherwise it should be null.

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, ios

  • brand: a url or a brand name.

Supported event types

`add:casino_game` : captures a casino game

```json { "data": { "game_id": "123456", "game_name": "Hall Of Gods", "category": "slots", "provider": "GameStudioX", "enabled": "true" }, "event_type": "add:casino_game" }

</details>

<details>
  <summary>`clicks:event` : captures a user click on a sport event. `user_id` is required</summary>
```json
{
  "data": {
    "event_id": "1018561959",
    "position": 0,
    "location": "widget:recommended",
    "page": "/home"
  },
  "event_type": "clicks:event",
  "user_id": "123456"
}
`clicks:outcome` : captures a user click on a sport outcome. `user_id` is required

```json { "data": { "event_id": "1018561957", "outcome_id": "3086187161", "location": "widget:recommended", "page": "/home", "position": 1 }, "event_type": "clicks:outcome", "user_id": "520535" }

</details>

<details>
  <summary>`clicks:sport` : captures a user click on a sport. `user_id` is required</summary>
```json
{
  "data": {
    "sport_id": "1000093190",
    "location": "widget:recommended",
    "page": "/home",
    "position": 1
  },
  "event_type": "clicks:sport",
  "user_id": "123456"
}
`clicks:league` : captures a user click on a league. `user_id` is required

```json { "data": { "league_id": "1000093652", "location": "widget:recommended", "page": "/home", "position": 1 }, "event_type": "clicks:league", "user_id": "654321" }

</details>

<details>
  <summary>`clicks:combination` : captures a user selecting the recommended combination. `user_id` is required</summary>
```json
{
  "data": {
    "selections": [
      {
        "id": "123",
        "event_id": "001234"
     },
      {
        "id": "124",
        "event_id": "001238"
     }
    ],
    "location": "widget:recommended",
    "page": "/home"
  },
  "event_type": "clicks:combination",
  "user_id": "654321"
}
`clicks:menu-item` : captures a click on a menu item. `user_id` is required

```json { "data": { "menu": "recommendations", "item": "trending", "location": "widget:recommended", "page": "/home" }, "event_type": "clicks:menu-item", "user_id": "654321" }

</details>

<details>
  <summary>`clicks:social` : captures a user click on a sharing button. `user_id` is required</summary>
```json
{
  "data": {
    "location": "widget:recommended",
    "page": "/home",
    "item": "open-sharing-dialog"
  },
  "event_type": "clicks:social",
  "user_id": "654321"
}
`clicks:game` : captures a user click on a casino game. `user_id` is required

```json { "data": { "game_id": "HallOfGods", "page": "CategoryPageJackpots", "position": "3", "location": "swim_lane:recommended" }, "event_type": "clicks:game", "user_id": "654321" }

</details>

<details>
  <summary>`impressions:events` : captures the events that appeared on user interface. `user_id` is required</summary>
```json
{
  "data": {
    "events": [
      {
        "id": 21161819
      },
      {
        "id": 21161822
      },
      {
        "id": 21168411
      }
    ],
    "location": "widget:recommended",
    "page": "/home"
  },
  "event_type": "impressions:events",
  "user_id": "520535"
}
`impressions:leagues` : captures the leagues that appeared on user interface. `user_id` is required

```json { "data": { "leagues": [ { "id": 18265893 }, { "id": 2969 }, { "id": 686 } ], "location": "widget:recommended", "page": "/home" }, "event_type": "impressions:leagues", "user_id": "520535" }

</details>

<details>
  <summary>`impressions:sports` : captures the sports that appeared on user interface. `user_id` is required</summary>
```json
{
  "data":{
    "sports": [
      {
        "id": "23204141"
      },
      {
        "id": "23390907"
      },
      {
        "id": "23032119"
      }
    ],
    "location": "widget:recommended",
    "page": "/home"
  },
  "event_type": "impressions:sports",
  "user_id": "654321"
}
`impressions:games` : captures the casino games that appeared on user interface. `user_id` is required

```json { "data": { "channel": "Desktop", "game_ids": [ { "id": "TigerEmperor" }, { "id": "NarcosMexico" }, { "id": "EyeOfTheStorm" }, { "id": "AmazingLinkFates" }, { "id": "CashUltimate" }, { "id": "SantasWonderland" } ], "page": "CategoryPageSlots", "location": "swim_lane" }, "event_type": "impressions:games", "user_id": "654321" }

</details>

<details>
  <summary>`engagement:add_bet` : captures a user adding a bet in betslip. `user_id` is required</summary>
```json
{
  "data": {
    "event_id": "1018642410",
    "selection_id": "1018632560",
    "location": "widget:recommended",
    "page": "/home",
    "position": 1
  },
  "event_type": "engagement:add_bet",
  "user_id": "654321"
}
`engagement:place_ticket` : captures a user placing a recommended bet. `user_id` is required

```json { "data": { "selections": [ { "id": "3086198780" } ], "location": "widget:recommended", "page": "/home", "position": 1 }, "event_type": "engagement:place_ticket", "user_id": "9860015" }

</details>

<details>
  <summary>`users:login` : captures the login of a user. `user_id` is required</summary>
```json
{
  "event_type": "users:login",
  "user_id": "9860015"
}
`impressions:page` : captures the page that appeared on the user interface. `user_id` is required

```json { "data": { "user": "654321", "previous_location": "http://localhost:3000/#home", "location": "http://localhost:3000/#in-play" }, "event_type": "impressions:page", "user_id": "654321" }

</details>

<details>
  <summary>`impressions:widget` : captures the widget that appeared on the user interface. `user_id` is required</summary>
```json
{
  "data": {
    "user": "654321",
    "location": "http://localhost:3000/#home"
  },
  "event_type": "impressions:widget",
  "user_id": "654321"
}
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Header parameters
x-vaix-client-idstringRequired

Custom client header, the value should be the name of the group the user belongs to

x-vaix-authentication-methodstringOptional

Authentication method to be used, supported values [vaix, iam]. Defaults to vaix

Body

A tracker event object

dataobjectOptional

The tracking event info

event_typestring · enumOptional

The type of the event

Possible values:
user_idstringOptional

The user identifier

Responses
post
/api/tracker/events
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?