TrackBee DocsTrackBee Docs
Tracking SDKEvents

checkout_started

Someone reached checkout, with the cart they are checking out.

Send this when a visitor enters checkout, with everything in the cart at that moment.

trackbee.track('checkout_started', {
  currency: 'EUR',
  total_price: '68.49',
  discount_codes: ['SPRING10'],
  discount_amount: '5.99',
  line_items: [
    {
      product_id: '8472019',
      variant_id: '4410228',
      price: '29.99',
      quantity: 2,
      currency: 'EUR',
      product_title: 'Field Jacket',
      variant_title: 'Olive / M',
      sku: 'NB-FJ-OLV-M',
    },
    {
      product_id: '8472020',
      variant_id: '4410301',
      price: '14.50',
      currency: 'EUR',
      product_title: 'Wool Beanie',
      variant_title: 'Charcoal',
      sku: 'NB-WB-CHR',
    },
  ],
});

Fields

FieldTypeRequired
line_itemslist of line items, at least oneyes
currencystringno
total_pricepriceno
discount_codeslist of stringsno
discount_amountpriceno

line_items must not be empty. An empty list drops the event:

[TrackBee] track("checkout_started") did not send the event. Invalid fields: line_items must not be empty

total_price is what the shopper would pay for this checkout, after any discount.

discount_amount is the total discount on the checkout, as a positive amount. Do not pass it as a negative number.

Line items

Each entry in line_items takes these fields.

FieldTypeRequired
product_idstring or numberyes
variant_idstring or numberyes
pricepriceyes
quantitywhole number, at least 1no, defaults to 1
currencystringno
product_titlestringno
variant_titlestringno
product_typestringno
product_urlstringno
image_urlstringno
vendorstringno
skustringno
line_titlestringno
final_line_pricepriceno

price is the unit price. Do not multiply it by the quantity.

final_line_price is what this line actually costs after any discount on it, for the whole quantity. Send it when a line can be discounted on its own, otherwise leave it out.

line_title is the checkout line's own title, where your platform keeps one separately from the product title. Most do not, so this is usually left out.

Set currency on every line item

Line items do not inherit the currency you set on the checkout. A line without its own currency arrives without one, even when the checkout has one. Set it on each line.

The minimum

trackbee.track('checkout_started', {
  line_items: [
    { product_id: '8472019', variant_id: '4410228', price: '29.99', currency: 'EUR' },
  ],
});

On this page