Skip to content

Capture customer activity

Overview

Use this endpoint to capture a customer's activity throughout a session. A variety of event types are available which can be used to model specific interactions by the customer, such as interacting with an offer, denoting an impression from an Ad, or browsing their customer profile.

Important

Some event types also require a metadata object to be provided in order to accurately represent the behavior being modeled. It is up to you to ensure your application correctly captures the right metadata, depending on the event being sent.

NEED TO FIX THESE LINKS: See the examples below, as well as the ClientEventMessage and ClientEventMetadata type definitions, for more information.

1
POST /v2/events/clientEvent

Input Parameters

Property Type Required Description
clientEvents ClientEventMessage[] Required A list of client event messages

Output

This endpoint returns an HTTP response indicating success or failure.


Examples

Logging a viewable impression event

In this example, a customer's ad impression is being logged.

Once processed, this event would transition the ad's visibility state relative to the customer from NEW to SERVED.

The ad is the third element in its category, so a zero-indexed displayPosition of 2 is logged.

1
POST /v2/events/clientEvent
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
    "clientEvents": [
        {
            "clientEventId": "2e08d638-04e2-4561-b56a-ca32cfff6203",
            "clientEventType": "AdImpression",
            "clientEvent": "AdViewableImpression",
            "clientEventTimestamp": "2023-03-11T08:00:00Z",
            "clientEventMetadata": {
                "serveToken": "91e471aed3c04b81bee792f23ad4859d",
                "section": "LatestOffers",
                "channel": "OLB",
                "imageSlots": [
                    "logo"
                ],
                "categoryId": "1",
                "displayPosition": 2
            }
        }
    ]
}

Activating an offer

In this example, a customer has engaged with the offer attached to an ad.

Once processed, this event would transition the ad's state relative to the customer from SERVED to ACTIVATED.

1
POST /v2/events/clientEvent
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "clientEvents": [
        {
            "clientEventId": "2e08d638-04e2-4561-b56a-ca32cfff6203",
            "clientEventType": "AdInteraction",
            "clientEvent": "ActivateOffer",
            "clientEventTimestamp": "2023-03-11T08:00:00Z",
            "clientEventMetadata": {
                "serveToken": "91e471aed3c04b81bee792f23ad4859d",
                "section": "LatestOffers",
                "channel": "OLB",
                "imageSlots": [
                    "logo"
                ],
                "categoryId": "1",
                "curationId": "22",
                "displayPosition": 2
            }
        }
    ]
}

Hiding offers

In this example, a customer has indicated that they are not interested in seeing a particular offer. Once the event is processed, the ad will no longer be returned to the user in subsequent Get Ads calls.

Submitting an UnParkOffer event would allow the offer to be again.

1
POST /v2/events/clientEvent

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
    "clientEvents": [
        {
            "clientEventId": "2e08d638-04e2-4561-b56a-ca32cfff6203",
            "clientEventType": "AdInteraction",
            "clientEvent": "ParkOffer",
            "clientEventTimestamp": "2023-03-11T08:00:00Z",
            "clientEventMetadata": {
                "serveToken": "91e471aed3c04b81bee792f23ad4859d",
                "section": "LatestOffers",
                "channel": "OLB",
                "imageSlots": [
                    "logo"
                ],
                "categoryId": "1",
                "curationId": "22"
            }
        }
    ]
}

Logging other client activity

This example shows a client event indicating that a user has logged into their banking app, expanded a redemption in their customer profile, and clicked a link in their reward summary.

1
POST /v2/events/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
{
    "clientEvents": [
        {
            "clientEventId": "2e08d638-04e2-4561-b56a-ca32cfff6203",
            "clientEventType": "SessionAction",
            "clientEvent": "LogEnrollment",
            "clientEventTimestamp": "2023-03-11T08:00:00Z",
            "clientEventMetadata": null
        },
        {
            "clientEventId": "7a26012c-8ede-4375-a956-8af1c27f5280",
            "clientEventType": "CustomerProfileAction",
            "clientEvent": "ExpandRedemption",
            "clientEventTimestamp": "2023-03-11T08:05:00Z",
            "clientEventMetadata": null
        },
        {
            "clientEventId": "ad664ef4-5bcb-4a54-b787-efa500e723fd",
            "clientEventType": "SessionAction",
            "clientEvent": "RewardSummaryLinkClicked",
            "clientEventTimestamp": "2023-03-11T08:07:00Z",
            "clientEventMetadata": null
        }
    ]
}

Example Response

1
2
3
{
    "requestId": "380052b4-3a64-4952-b640-ba696eb9f44b"
}