Skip to content

Logging Client Events

Note

As of Ad Server v3, the POST /events/<token>/clientevent endpoint URI has been changed to the below endpoint. The endpoint behavior and input have not changed, only the URI, and the old endpoint URI will continue to work for all clients.

Use this endpoint for logging client events, and user activities that require monitoring when using the Cardlytics OPS API.

1
POST /customers/<token>/events/clientevent

Input Parameters

In addition to the query parameter, this endpoint requires a JSON body be posted.

Path Param Type Required Description
token string Required The security token for the customer
JSON Prop Type Required Description
clientEventCommand ClientEventMessage[] Required A list of client event messages

Output

This endpoint returns an HTTP response indicating success (200) or failure (500).


Example

Request

1
POST /api/v1/events/C1FA3C38-1B28-4B54-A2F8-E577FFEEF9F5/clientevent
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
   "clientEventMessages":[
      // For events that happen on an ad
      // include the ad ID, impressionToken, and other ad-specific fields
      {
         "eventTypeId": 3, // link clicked
         "adId": 1,
         "impressionToken" : "91e471aed3c04b81bee792f23ad4859d",
         "channelId" : 1,
         "locationId" : 32,
         "displayTypeId" : 6,
         "tags": [
            "purchase-channel"
         ],
         "imageSlots": [
            "logo",
            "heroImage"
         ],
         "displayPosition": 4
      },

      // For events on ads filtered by category, include the category ID
      {
         "eventTypeId": 3,
         "adId": 2,
         "impressionToken" : "91e471aed3c04b81bee792f23ad4859d",
         "channelId" : 1,
         "locationId" : 32,
         "displayTypeId" : 6,
         "tags": [],
         "imageSlots": [
            "logo"
         ],
         "displayPosition": 2, // position in the filtered view
         "groupTypeId" : 1, // Category
         "groupId" : 5 // Category filtered by
      },

      // For events directly on collections or categories, ad information can be omitted
      {
         "eventTypeId": 224,
         "channelId" : 1,
         "locationId" : 32,
         "displayTypeId" : 6,
         "displayPosition": 2, // relative position of the ad or category
         "groupTypeId" : 1, // Category
         "groupId" : 5 // Category interacted with
      },

      // For events not related to an ad or group, most fields can be omitted
      {
         "eventTypeId": 18,
         "channelId": 1,
         "locationId": 32,
         "displayTypeId": 6,
      }
   ]
}