Add to Cart
This document describes the Out-Of-The-Box (OOTB) Add To Cart event schema for use in your integrations. This event—together with the Remove From Cart event and the Empty Cart event—is necessary for cart-and-product abandonment use cases.
Event Key
| Event Key | Event Name | Type |
|---|---|---|
ootb_add_to_cart | Add To Cart | Simple event |
Event Structure
The mandatory properties (tenant, timestamp, event, and customer) are required for all events and documented in detail on the Mandatory Properties page
Below is the JSON structure for the context-specific properties of the Add To Cart event.
{
"context": {
"ootb_session_id": "248rhdbuw2her1",
"ootb_userid": "ExampleUser1234",
"ootb_eventdatetime": "2024-03-09T07:00:14.000Z",
"ootb_product_id": "10Pencils1843",
"ootb_variant_id": "10Pencils1843Coloured1234",
"ootb_sku_id": "10Pencils1843Coloured1234-23iuhw",
"ootb_brand": "Example Brand",
"ootb_category": "C-P3nc1l",
"ootb_department": "D-St4t10n4ry",
"ootb_url": "https://www.example.com/product/10Pencils1843",
"ootb_page_title": "Coloured Pencils",
"ootb_page_category": "Pencils",
"ootb_currency": "GBP",
"ootb_item_name": "Coloured Pencils 10 pack.",
"ootb_quantity": 2,
"ootb_total_price": 30.00,
"ootb_tax_amount": 2.00,
"ootb_delivery_fee": 4.99,
"ootb_fullfillment_type": "standard_delivery"
}
}
Parameters
| Parameter Key | Parameter Name | Type | Description | Mandatory for Opti-X? |
|---|---|---|---|---|
ootb_session_id | Session ID | String | User’s browser session identifier. | No |
ootb_userid | User ID | String | Unique key identifying the user. | Yes |
ootb_eventdatetime | Event Date Time | Timestamp | Date and time of the add to cart action. | Yes |
ootb_product_id | Product ID | String | Unique key for the product. | Yes |
ootb_variant_id | Variant ID | String | Key identifying the variant of the product. | No |
ootb_sku_id | SKU ID | String | Key identifying the SKU of the variant. | No |
ootb_brand | Brand | String | Brand of the product. | Yes |
ootb_category | Category | String | Key identifying the lowest level of product category. | Yes |
ootb_department | Department | String | Key identifying the department or highest-level category. | Yes |
ootb_url | URL | String | Link to the product-/variant-/SKU page. | No |
ootb_page_title | Page Title | String | Title of the page where the action occurred. | No |
ootb_page_category | Page Category | String | Category label of that page. | No |
ootb_currency | Currency | String | Currency code (e.g., GBP). | Yes |
ootb_item_name | Item Name | String | Name of the product/variant/SKU (lowest level). | No |
ootb_quantity | Quantity | Number | Quantity of the item added to the cart. | No |
ootb_total_price | Total Price | Number | Total price (quantity × unit price, after discounts and including tax). | No |
ootb_tax_amount | Tax Amount | Number | Tax for this line (considering quantity). | No |
ootb_delivery_fee | Delivery Fee | Number | Delivery or shipping fee. | No |
ootb_fullfillment_type | Fulfillment Type | Enum | bopis or standard_delivery to indicate pickup vs delivery. | No |
Explanation
- event: Set to
ootb_add_to_cartwhen an item is added to the cart. - context:
ootb_session_id,ootb_userid: Link the action to the user’s session and identity.ootb_eventdatetime: Timestamp of the add to cart action.- Product identifiers (
ootb_product_id,ootb_variant_id,ootb_sku_id,ootb_brand,ootb_category,ootb_department): Identify exactly what was added. - Page context (
ootb_url,ootb_page_title,ootb_page_category): Where the action occurred. - Pricing & quantity (
ootb_currency,ootb_item_name,ootb_quantity,ootb_total_price,ootb_tax_amount,ootb_delivery_fee): Capture the economic details of the line item being added. ootb_fullfillment_type: Indicates “Buy Online, Pick Up In Store” (bopis) vs home delivery (standard_delivery) for the item.
Updated 3 months ago
