Events (v2)
Create Events
There are 5 types of events:
- page_view
- click
- add_to_cart
- purchase
- element_visible
For most integrations, we recommend sending `add_to_cart` events. Note that most of the event fields are not mandatory.
See more details about each event field below.
For events of type `click` the `recommendation_id` for the clicked recommendation (which is returned from the `/recommend` endpoint)
should be set if available.
Examples requests:
<pre>
[{
"tenant": "my_store",
"market": "us",
<mark>"type": "page_view",</mark>
"user_id": "GA1.2.00000000.0000000000",
"url": "https://my_store.com/awesome_mechanical_keyboard.html",
"product_id": "BLA-KEY-XXX",
"entity_identifiers": {
"sku": "31415"
},
"entity_price": "100$",
"document_width": "300"
}]
</pre>
<pre>
[{
"tenant": "my_store",
"market": "us",
<mark>"type": "click",</mark>
"user_id": "ga1.2.00000000.0000000000",
"url": "https://my_store.com/awesome_mechanical_keyboard.html",
"product_id": "bla-key-xxx",
"entity_identifiers": {
"sku": "31415"
},
"entity_price": "100$",
"document_width": "300",
<mark>"recommendation_id": "827ada29-92e7-4642-8805-8b7105a9c8a5",</mark>
<mark>"click_location": "landing_page_recommendation_1"</mark>
}]
</pre>
<details>
<summary>View more examples</summary>
<pre>
[{
"tenant": "my_store",
"market": "us",
<mark>"type": "add_to_cart",</mark>
"user_id": "GA1.2.00000000.0000000000",
"url": "https://my_store.com/awesome_mechanical_keyboard.html",
"product_id": "BLA-KEY-XXX",
"entity_identifiers": {
"sku": "31415"
},
"entity_price": "100$",
"document_width": "300"
}]
</pre>
<pre>
[{
"tenant": "my_store",
"market": "us",
<mark>"type": "purchase",</mark>
"user_id": "GA1.2.00000000.0000000000",
"url": "https://my_store.com/checkout.html",
"product_id": "BLA-KEY-XXX",
"entity_identifiers": {
"sku": "31415"
},
"entity_price": "100$",
"document_width": "300"
}]
</pre>
<pre>
[{
"tenant": "my_store",
"market": "us",
<mark>"type": "element_visible",</mark>
"user_id": "GA1.2.00000000.0000000000",
"url": "https://my_store.com/checkout.html",
"product_id": "BLA-KEY-XXX",
"entity_identifiers": {
"sku": "31415"
},
"entity_price": "100$",
"document_width": "300",
<mark>"recommendation_id": "827ada29-92e7-4642-8805-8b7105a9c8a5"</mark>
}]
</pre>
</details>
POST
Authorizations
Body
application/json · object[]
The body is of type object[]
.
Response
200
application/json
Successful Response
The response is of type any
.