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
| Field | Type | Required |
|---|---|---|
line_items | list of line items, at least one | yes |
currency | string | no |
total_price | price | no |
discount_codes | list of strings | no |
discount_amount | price | no |
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 emptytotal_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.
| Field | Type | Required |
|---|---|---|
product_id | string or number | yes |
variant_id | string or number | yes |
price | price | yes |
quantity | whole number, at least 1 | no, defaults to 1 |
currency | string | no |
product_title | string | no |
variant_title | string | no |
product_type | string | no |
product_url | string | no |
image_url | string | no |
vendor | string | no |
sku | string | no |
line_title | string | no |
final_line_price | price | no |
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' },
],
});