Cart status event
The cart status
event (status:cart
) must be sent when the user visits the cart page or modifies the shopping cart. This is helpful in calculating the cart abandonment metrics and is an alternate way to send cart information instead of using the a2c
event.
The following table lists the properties of the cart status
event:
Name |
Type |
Description |
Value |
---|---|---|---|
|
String |
Required. Type of the event. |
|
|
String |
Required. Name of the event. |
|
|
Array |
Required. Products array having one or more product objects that were in the cart. To facilitate processing, the Discover system splits the
Note Products array and its individual SKUs are used in computing cart-related analytics. |
n/a |
|
String |
Required. SKU of the product that was in the cart. Used to calculate abandoned cart metrics. |
n/a |
|
Number |
Optional. Unit price of the product that is added to cart. Used to compute the abandonment amount ( |
n/a |
|
Number |
Required. Number of units of products that were added to cart. Along with |
n/a |
|
Array |
Required if site supports fitments. Array of fitment objects. Refer to products and fitments for details. Used to compute fitment analytics. |
n/a |
|
Object |
Required if site is set up with locale configuration. Adds page-specific information (including locale information) under the page object. |
n/a |
|
Object |
Optional A locale object. This attribute is deprecated. We suggest you use the page object for locale data. |
n |
Sample event specification
The following is an example of a cart status
event object. This example is in the new format, which means it contains a context
object.
{
"type": "status",
"name": "cart",
"value": {
"context": {
"page": {
"locale_country": "<country code, 2 letters, lowercase, e.g. fr>",
"locale_language": "<language code 2 letters, lowercase, e.g. en>",
"locale_currency": "<currency code, 3 letters, lowercase, e.g. eur>"
}
},
"products": [
{
"sku": "191258",
"quantity": 1,
"price": 11.99,
"fitment": {
"ids": [
"3333"
]
}
},
{
"sku": "2402",
"quantity": 1,
"price": 12.99,
"fitment": {
"ids": [
"3333"
]
}
}
]
}
}