cart_updated

After every price update.

CODE
next.analytics.on('cart_updated', (event) => {});

Triggered by cart.calculated.

Data

Present: always; optional when it may be missing; campaign once the campaign is loaded; priced once the server priced the cart.

FieldTypePresent
linesCartItem[]alwaysEvery line in the cart, the same package's lines merged.
couponsstring[]alwaysThe codes the shopper applied, uppercase. A bundle card's own codes are not listed.
currencystringcampaignISO 4217, such as USD.
shipping_methodShippingMethodoptionalThe selected shipping method, and what shipping costs.
subtotalnumberpricedThe products before discounts, without shipping.
total_discountnumberpricedThe discounts on the products, without shipping's: the sum of discounts.
totalnumberpricedWhat the shopper pays.
discountsDiscount[]pricedThe discounts on the products, one per offer.
discount_percentagenumberpricedtotal_discount ÷ subtotal × 100, to two decimals; 0 without a discount.
quantitynumberalwaysUnits in the cart: each line's quantity.

CartItem

A line of the cart. Its prices are there once the server priced the cart.

FieldTypePresent
package_idnumberalwaysThe package's ref_id in the campaign.
quantitynumberalwaysPackage quantity.
is_upsellbooleanoptionaltrue for a line added after the order.
propertiesRecord<string, string>optionalLine properties, such as a variant picked in a bundle slot.
product_idnumbercampaignThe product in the store.
product_titlestringcampaignThe product's name as customers see it, as on an order line; the package's name for a package without one.
variant_idnumbercampaignThe product variant, for a product with variants.
variant_titlestringcampaignThe variant's name, such as Black / M, for a product with variants.
skustringcampaignThe product's Stock Keeping Unit.
imagestringcampaignThe package's image URL.
pricenumberpricedWhat one package costs after discounts.
original_pricenumberpricedWhat one package costs before discounts; equal to price when nothing is taken off.
total_discountnumberpricedThe discount on the line.
totalnumberpricedprice × quantity.
subtotalnumberpricedThe line before discounts: total = subtotal − total_discount.
discount_percentagenumberpricedtotal_discount ÷ subtotal × 100, to two decimals; 0 without a discount.
discountsDiscount[]pricedThe discounts on the line.
subscriptionSubscriptioncampaignFor a package billed again every interval.

ShippingMethod

The selected shipping method, and what shipping costs.

FieldTypePresent
idnumberalwaysThe method's ref_id.
codestringcampaignSuch as standard.
namestringpricedThe method's name.
pricenumberpricedWhat shipping costs after discounts; 0 is free shipping.
original_pricenumberpricedWhat shipping costs before discounts.
discountsDiscount[]pricedThe discounts on shipping, such as a free-shipping offer.

Discount

A discount on the cart's products or on its shipping. Amounts are in the cart's currency.

FieldTypePresent
namestringalwaysThe offer's name.
amountnumberalwaysThe amount taken off.
source"offer" | "coupon"alwayscoupon for a code the shopper entered (it is in coupons); offer for an automatic offer or a bundle card's own code.
codestringoptionalThe code, for a coupon.
offer_idnumberalwaysThe offer that gave it.
percentagenumberoptionalThe percentage the offer is set to take off, as the API reports it, such as 20. Its configured value, for a label such as “20% off”; the amount actually taken off is amount.

Subscription

A package billed again every interval.

FieldTypePresent
interval"day" | "month"alwaysThe unit of the renewal interval.
interval_countnumberalwaysHow many intervals between renewals.
pricenumberpricedWhat each renewal charges, after discounts.
original_pricenumberpricedWhat each renewal charges before discounts.

Example

The envelope next.analytics.on hands out, with data inside. See How analytics works for its fields.

CODE
{
  "event_id": "3f2b8c1d9e7a4b6c8d5e2f1a0b9c8d7e",
  "event_type": "cart_updated",
  "object": "cart",
  "data": {
    "lines": [
      {
        "package_id": 1,
        "quantity": 1,
        "product_id": 400,
        "product_title": "Earbuds ×1",
        "image": "https://cdn.test/1.png",
        "price": 49,
        "original_price": 99,
        "total_discount": 0,
        "total": 49,
        "subtotal": 49,
        "discount_percentage": 0,
        "discounts": []
      }
    ],
    "coupons": [],
    "quantity": 1,
    "currency": "USD",
    "shipping_method": {
      "id": 1,
      "code": "standard",
      "name": "Standard",
      "price": 0,
      "original_price": 0,
      "discounts": []
    },
    "subtotal": 49,
    "total_discount": 0,
    "total": 49,
    "discounts": [],
    "discount_percentage": 0
  },
  "created_at": "2026-11-04T08:30:00.000Z",
  "session_id": "0b8f3c2d1e4a4f6b9c7d5e3f2a1b0c9d",
  "sdk_version": "0.5.0",
  "context": {
    "page_location": "https://shop.test/checkout/",
    "page_title": "Olympus Earbuds",
    "page_referrer": "",
    "campaign": {
      "id": 1310,
      "name": "Olympus",
      "currency": "USD",
      "language": "en"
    },
    "session_id": "0b8f3c2d1e4a4f6b9c7d5e3f2a1b0c9d",
    "attribution": {
      "funnel": "Olympus"
    },
    "browser": {
      "user_agent": "Mozilla/5.0 …",
      "language": "en-US",
      "device_type": "desktop"
    }
  }
}

Sent to