trackEcommerceOrder
Deprecated
This method is no longer recommended.
The trackEcommerceOrder() method tracks a confirmed order. The order contains items added to the cart with the addEcommerceItem() method.
Syntax
trackEcommerceOrder(orderID, orderGrandTotal\[, orderSubTotal\[, orderTax\[, orderShipping[, orderDiscount]]]])
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
Parameters
orderID (string, required)
The unique order ID.
orderGrandTotal (number, required)
Total payment for the order. Includes tax, shipping and discounts.
orderSubTotal (number, optional)
Payment for the order without shipping.
orderTax (number, optional)
Tax included in the order.
orderShipping (number, optional)
Shipping costs for the order.
orderDiscount (number, optional)
Discounts included in the order.
Examples
To track a confirmed order:
// register all purchased items
_paq.push([
"addEcommerceItem",
"584340", // SKU
"Specialized Stumpjumper", // name
"Mountain bike", // category
5000, // price
1, // quantity
]);
_paq.push([
"addEcommerceItem",
"460923", // SKU
"Specialized Chamonix", // name
"Helmets", // category
200, // price
1, // quantity
]);
// track order
_paq.push([
"trackEcommerceOrder",
"43967392", // order ID
5250, // grand total (value + tax + discount + shipping)
5200, // sub total (value + tax + discount)
970, // tax
150, // shipping
100, // discount
]);
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
trackEcommerceOrder(orderId, orderGrandTotal, orderSubTotal?, orderTax?, orderShipping?, orderDiscount?): void
Notes
- This method clears the list of items in the cart.
Related methods
- addEcommerceItem() (deprecated)
- removeEcommerceItem() (deprecated)
- clearEcommerceCart() (deprecated)
- getEcommerceItems() (deprecated)
- setEcommerceView() (deprecated)
- trackEcommerceCartUpdate() (deprecated)
Updated 6 days ago