curl --request POST \
--url https://api.topsort.com/v2/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"impressions": [
{
"id": "eb874c98-bf4d-40a9-ae6d-fcf4cecb535c",
"occurredAt": "2019-01-01T12:59:59-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"placement": {
"path": "/categories/dairy",
"position": 1,
"page": 1,
"pageSize": 15,
"categoryId": "9BLIe"
},
"resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=",
"deviceType": "mobile",
"channel": "onsite"
}
],
"clicks": [
{
"id": "b39d39ed-ea0e-4059-9d15-4990b39c85a2",
"occurredAt": "2019-01-01T13:01:42-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"placement": {
"path": "/categories/dairy",
"position": 1,
"page": 1,
"pageSize": 15,
"categoryId": "9BLIe"
},
"resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=",
"deviceType": "mobile",
"channel": "offsite"
}
],
"purchases": [
{
"id": "0e06c899-b2cd-4e0d-b0de-8aefb4b6d0a0",
"items": [
{
"productId": "p_SA0238",
"unitPrice": 12.95,
"quantity": 2,
"vendorId": "v_8fj2D"
},
{
"productId": "p_oajf2D",
"unitPrice": 1.49
}
],
"occurredAt": "2019-01-01T12:59:59-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"deviceType": "desktop",
"channel": "onsite"
},
{
"id": "b7147656-504f-4ae7-b335-740829ff64c6",
"items": [
{
"productId": "p_SA0279",
"unitPrice": 119.95,
"quantity": 5,
"vendorId": "v_8fj2D"
}
],
"occurredAt": "2019-01-01T13:59:59-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"channel": "instore"
}
],
"pageviews": [
{
"id": "8f648a8e-830c-4bb4-9d93-6ea80075ca82",
"occurredAt": "2019-01-01T12:59:58-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"page": {
"type": "category",
"pageId": "/categories/dairy",
"value": "dairy"
},
"deviceType": "mobile",
"channel": "onsite"
}
]
}'
This response does not have an example.
Use the /events
endpoint to report user interactions and activity in on a marketplace:
Interactions require either a resolvedBidId
, for sponsored events coming from the /v2/auctions
response,
or an entity
that describes the entity that was interacted with, in the case of organic or non-sponsored events.
For analytics purposes, you can use the placement
field to differentiate different listings or banners.
For example, on a product page with a carousel of products, you can track impressions and clicks related to the carousel
by including /carousel
at the end of the path
field in the placement
object. This allows you to monitor
the performance of carousel products in the Data Room.
curl --request POST \
--url https://api.topsort.com/v2/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"impressions": [
{
"id": "eb874c98-bf4d-40a9-ae6d-fcf4cecb535c",
"occurredAt": "2019-01-01T12:59:59-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"placement": {
"path": "/categories/dairy",
"position": 1,
"page": 1,
"pageSize": 15,
"categoryId": "9BLIe"
},
"resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=",
"deviceType": "mobile",
"channel": "onsite"
}
],
"clicks": [
{
"id": "b39d39ed-ea0e-4059-9d15-4990b39c85a2",
"occurredAt": "2019-01-01T13:01:42-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"placement": {
"path": "/categories/dairy",
"position": 1,
"page": 1,
"pageSize": 15,
"categoryId": "9BLIe"
},
"resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=",
"deviceType": "mobile",
"channel": "offsite"
}
],
"purchases": [
{
"id": "0e06c899-b2cd-4e0d-b0de-8aefb4b6d0a0",
"items": [
{
"productId": "p_SA0238",
"unitPrice": 12.95,
"quantity": 2,
"vendorId": "v_8fj2D"
},
{
"productId": "p_oajf2D",
"unitPrice": 1.49
}
],
"occurredAt": "2019-01-01T12:59:59-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"deviceType": "desktop",
"channel": "onsite"
},
{
"id": "b7147656-504f-4ae7-b335-740829ff64c6",
"items": [
{
"productId": "p_SA0279",
"unitPrice": 119.95,
"quantity": 5,
"vendorId": "v_8fj2D"
}
],
"occurredAt": "2019-01-01T13:59:59-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"channel": "instore"
}
],
"pageviews": [
{
"id": "8f648a8e-830c-4bb4-9d93-6ea80075ca82",
"occurredAt": "2019-01-01T12:59:58-05:00",
"opaqueUserId": "71303ce0-de89-496d-8270-6434589615e8",
"page": {
"type": "category",
"pageId": "/categories/dairy",
"value": "dairy"
},
"deviceType": "mobile",
"channel": "onsite"
}
]
}'
This response does not have an example.
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
All events were reported successfully.