Product Added to Cart (product_added_to_cart)
Purpose:
Track when a user adds a product (or variant) to their shopping cart, capturing both quantity and context of where the action originated.
When to Fire:
Immediately after the “Add to Cart” action completes whether from a product page, quick-view modal, recommendation widget, or any listing.
Payload Schema:
| Field | Type | Description |
|---|---|---|
sku | string | The SKU of the product being viewed. |
variant_sku | string | The SKU of the selected variant (if any); otherwise the default variant SKU. |
quantity | number | Number of units added. |
total_value | number | Total value of items added (totalValue, e.g. price * quantity). |
mode | string | Where the view originated: |
– "widget" | ||
– "search" | ||
– "category" | ||
– "collection" | ||
– "direct" (e.g. bookmarked or deep link) | ||
search_term | string | Current search term (if mode is "search"). |
search_location | string | "quick" or "page" (if mode is "search"). |
search_source | string | For suggestion clicks, pass the autocomplete category key from the response (e.g., "popular_search", "recent_search"). |
used_suggestion | string | The exact suggestion text the user clicked (e.g., “shirts”, “jeans”). |
category | string | name (if mode is "category"). |
collection | string | Collection ID (if mode is "collection"). |
widget_rule | string | Rule ID that generated this view context. |
widget_rule_type | string | Type of rule. |
widget_id | string | Widget instance ID (if mode is "widget"). |
widget_context_type | string | Entity type for context. |
widget_context_data | string | Additional context payload. |
mode_details | object | Nested object repeating the above fields specific to the chosen mode. |
product_option | array of objects | Selected product options, each { name: <string>, value: <string> }. |
product_categories | array of objects | Category hierarchy for this product, each { id, name, provider_id }. |
facets | array | Active filters when navigating to the product (each { field, value }). |
request_id | string | Unique identifier |
page_depth | string | Current page number (1, 2, 3, etc.). |