trackEcommerceCartUpdate

❗️

Deprecated

This method is no longer recommended.

The trackEcommerceCartUpdate() method tracks items in the cart. The items need to be added first with the addEcommerceItem() method.

Syntax

trackEcommerceCartUpdate(cartAmount)
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void

Parameters

cartAmount (number, required)

The total value of the items in the cart.

Examples

To track the cart with added items:

// register all added items  
\_paq.push([  
  "addEcommerceItem",  
  "584340", // SKU  
  "Specialized Stumpjumper", // name  
  "Mountain bike", // category  
  5000, // price  
  1, // quantity  
]);

// send a cart update  
\_paq.push([  
  "trackEcommerceCartUpdate",  
  5000, // cart amount  
]);
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void
trackEcommerceCartUpdate(cartAmount): void

Notes

  • Make sure you've added items to the cart with the addEcommerceItem() method before using this method.
  • You can use the getEcommerceItems() method to see what items have been added to the cart.
  • The cart with added items is not stored in local storage. Make sure to add all items again after the page reloads.
  • In SPAs (single-page applications), the page doesn't reload after a visitor adds or removes items from the cart.
  • Before calling the trackEcommerceCartUpdate() method, you should use either (1) clearEcommerceCart() or (2) addEcommerceItem(), removeEcommerceItem(), clearEcommerceCart().

Related methods