Event Collection API
This is a RestAPI for collecting user event data for OPM (Omnicommerce Performance Management). By utilizing the Javascript SDK, you can easily collect user event data on most web-based or mobile web-based sites.
API Endpoint
The default API Endpoint is as follows, and the current latest version is 2023-01
.
https://opm.kr.omnicommerce.ai
Please note that the Event Collection API follows different Endpoint and version policies compared to other OMNICOMMERCE APIs. Be cautious when using it.
Retrieve API key
Authentication Key
All OMNICOMMERCE APIs are HTTP-based REST APIs and require an authentication key to use.
- Authentication keys are issued for each company.
- Be cautious not to expose the API Key to the outside.
Refer to the link below to find out how to check the authentication key in OMNICOMMERCE.
How to check workspace and solution
For accurate collection, it is recommended to collect workspace and solution information together with each event. Refer to the link below for how to check the workspace and solution.
Event Collection API
GET /2023-01/validation/: API key authentication check
Request Header
Name | Required | Type | Description |
---|---|---|---|
X-Api-Key | Required | String | API Key |
Response
200 ok
Example Responses
validation failed
{
"errors": "User is not authorized to access this resource with an explicit deny"
}
POST /2023-01/events/: Send event data
Request Header
Name | Required | Type | Description |
---|---|---|---|
X-Api-Key | Required | String | API Key (Refer to: API Authentication Guide) |
Content-Type | Required | String | Request Type. Only Application/json is supported. |
Request Body
The data should be sent as an array of EventObject, and up to 100 items can be transmitted at once.
Name | Required | Type | Description |
---|---|---|---|
data | Required | List[EventObject] | List of event data |
EventObject
The timestamp is in Unix Timestamp format (based on milliseconds). (e.g., 1680688317472
)
Name | Required | Type | Description |
---|---|---|---|
timestamp | Required | Double | Event occurrence time. Unix Timestamp (based on milliseconds) (e.g., 1680688317472 ) |
event | Required | String | Event type. Case-insensitive. |
deviceId | Required | String | Customer device ID |
transactionId | Required | String | Unique ID of the event (Recommend using ULID.) |
sdkVersion | Optional | String | Version of the Client SDK (e.g., 0.0.0 ) |
sdkName | Optional | String | Name of the Client SDK |
osName | Optional | String | OS name |
platformName | Required | String | Browser name (Chrome, Safari, Firefox, etc.) |
prevTranId | Optional | String | Previous transaction ID associated with the tracking event |
userId | Optional | String | Identifiable customer ID |
userAge | Optional | String | User's Age |
userGender | Optional | String | User's Gender |
workspaceId | Optional | String | Omnicommerce workspace ID to be used for recommendations |
solutionId | Optional | String | Omnicommerce product used One of [CSRCH, VRCMD, SRCMD, TAGG, IMMOD] |
productId | Optional | String | Product ID |
productName | Optional | String | Product name |
brandName | Optional | String | Product brand name |
productPrice | Optional | double | Discounted product price (original price if not discounted) |
productGender | Optional | String | Product gender |
suggestQueryId | Optional | String | Unique ID of the recommended product |
suggestProductIds | Optional | List[String] | List of recommended product IDs |
placement | Optional | String | Page where event occurred (Main, Detail, Product List etc) |
label | Optional | String | Keyword for tracking or analyzing event |
productLikeCount | Optional | double | Like count of product |
productReviewCount | Optional | double | Review count of product |
productReviewScore | Optional | double | Review score of product |
strategy | Optional | String | recommendation strategy |
extra | Optional | Object | A key-value formatted object for adding any additional data you want to include |
Solution ID
Currently, the following Solution IDs are supported. (Refer to: Event Manager)
Name | Description |
---|---|
CSRCH | Camera Search |
VRCMD | Visual Recommendations |
SRCMD | Styling Recommendation |
TAGG | Automated Product Tagging |
IMMOD | Image Moderation |
PRCMD | Personalized Recommendations |
Request Example
{
"data": [
{
"event": "result_load",
"deviceId": "42ed9720-5168-418f-b1ab-b2a0485cd435",
"timestamp": 1677487420217,
"transactionId": "01GT90NCSSG3WPJT2QRTCV6M92",
"osName": "Mac OS",
"platformName": "Chrome",
"suggestQueryId": "95826402-b04f-4829-a0ce-f60021d67794",
"workspaceId": "test_workspace",
"suggestProductIds": [
"MSC3PP2504CH",
...
],
"solutionId": "CSRCH",
"placement" : "main",
"tag": "fashion"
"extra":{
"productUrl": "https://test.com/123456",
...
}
},
{
"event": "recommend_view",
"deviceId": "42ed9720-5168-418f-b1ab-b2a0485cd435",
"timestamp": 1677487420237,
"transactionId": "01GT90NCTDGP6J2MATKZNNF719",
"osName": "Mac OS",
"platformName": "Chrome",
"sdkVersion": "0.0.0",
"sdkName": "sdk bot",
"suggestQueryId": "95826402-b04f-4829-a0ce-f60021d67794",
"workspaceId": "test_workspace",
"solutionId": "CSRCH",
"prevTranId": "01GT90NCSSG3WPJT2QRTCV6M92",
"productId": "MSC3PP2504CH"
}
]
}
Response
If some events fail to collect, it would be in FailedRecordCount field
Name | Type | Description |
---|---|---|
FailedRecordCount | Integer | Failed event counts to collect |
Records | List[Object] | event records response list |
├ Records.ErrorCode | String | Error code fail to collect each events |
Example Responses
200 OK
All events collect successfully.
{
"FailedRecordCount": 0,
"Records": [
{},
{},
...
]
}
Some events failed to collect.
{
"FailedRecordCount": 1,
"Records": [
{},
{
"ErrorCode": "ProvisionedThroughputExceededException"
},
...
]
}
400 Bad Request
Missing required values in Event JSON
{
"errors": "Invalid request body"
}