Skip to main content

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:
FieldTypeDescription
skustringThe SKU of the product being viewed.
variant_skustringThe SKU of the selected variant (if any); otherwise the default variant SKU.
quantitynumberNumber of units added.
total_valuenumberTotal value of items added (totalValue, e.g. price * quantity).
modestringWhere the view originated:
  "widget"
  "search"
  "category"
  "collection"
  "direct" (e.g. bookmarked or deep link)
search_termstringCurrent search term (if mode is "search").
search_locationstring"quick" or "page" (if mode is "search").
search_sourcestringFor suggestion clicks, pass the autocomplete category key from the response (e.g., "popular_search", "recent_search").
used_suggestionstringThe exact suggestion text the user clicked (e.g., “shirts”, “jeans”).
categorystringname (if mode is "category").
collectionstringCollection ID (if mode is "collection").
widget_rulestringRule ID that generated this view context.
widget_rule_typestringType of rule.
widget_idstringWidget instance ID (if mode is "widget").
widget_context_typestringEntity type for context.
widget_context_datastringAdditional context payload.
mode_detailsobjectNested object repeating the above fields specific to the chosen mode.
product_optionarray of objectsSelected product options, each { name: <string>, value: <string> }.
product_categoriesarray of objectsCategory hierarchy for this product, each { id, name, provider_id }.
facetsarrayActive filters when navigating to the product (each { field, value }).
request_idstringUnique identifier
page_depthstringCurrent page number (1, 2, 3, etc.).
Example: