Shopping Tracker API reference
Create events
This endpoint receives a list of events and registers them as tracking data.
Endpoint: POST https://cubki.jp/trackers/events/shopping/assistants/ASSISTANT_ID.json
Path parameters
Assistant ID
Identifier of your #CBK Assistant
- Placeholder:
ASSISTANT_ID
- Type: Number (Required)
- Example:
16
More details: Assistant ID
Content Type
application/json
Payload
Tracking ID
A unique identifier, that identifies a specific user globally.
We recommend using a prefix like a company name to avoid conflict.
Sending events without trackingId
is allowed. But, since this is used to make a session to track users’ behavior, it is strongly recommended to send this value. Event data without trackingId
may not be used when analyzing.
- Field:
trackingId
- Type: String
- Example:
mycompany/47b44a60-d8b8-4374-bd33-8777de8961e3
Namespace
Name for separating tracking data.
- Field:
namespace
- Type: String (Required)
- Constraints
- Maximum length: 64 characters
- Example:
website1-tracking
More details: Namespace
List of events
Actual tracking events.
- Field:
events
- Type: Array of Event (Required)
- Example:
[{ "type": "impression", "productId": "ABC-1" }]
More details: How to make an event object
Example request with curl
Prepare a variable and a payload.
$ ASSISTANT_ID=<Your #CBK assistant ID>
$ cat <<PAYLOAD > events.json
{
"events": [
{
"productId": "product-1",
"type": "impression"
},
{
"productId": "product-2",
"type": "impression"
}
],
"namespace": "website1-tracking",
"trackingId": "mycompany/ef5553d9-f5a2-42cb-99dd-26d769f00657"
}
PAYLOAD
Send the payload to the endpoint
$ curl -X POST -H "Content-Type: application/json" https://cubki.jp/trackers/events/shopping/assistants/${ASSISTANT_ID}.json --data @events.json
{}
Responses
- Successful case
- Status:
202
- Body: Empty JSON (
{}
)
- Status:
- Client error cases
- Status:
4xx
(400
-499
) - Body: Object containing errors
- Status: