Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

How do I track multiple products added to a shopping cart?

Last Updated: November 28, 2012
Text Size: A A A

Save to My Help

Save this article to My Help for easy reference. You can visit the article at any time from any computer.

Replace an article

You have reached the maximum number of saved articles. Your oldest saved article will be replaced with the new one.

You can count the number of times your add to cart / add to shopping basket functionality was used by using the ADD_TO_CART action in your Yahoo! Web Analytics tracking code.

Here is a sample of how your code could look if you implement the ADD_TO_CART action, inflating the setAction method on the execution of the add to cart action.



var YWATracker = YWA.getTracker("1000123xxxx");
YWATracker.setAction("ADD_TO_CART");
YWATracker.setDocumentGroup("Product Pages");
YWATracker.setDocumentName("Demo Product");
YWATracker.submit();


To check which products were actually added to the shopping cart, you need to have implemented Merchandising tracking (see also How do I track the products I am selling?) because you're going to introduce the setSKU method to your Add to Cart tracking.

So now, your code could look like this:



var YWATracker = YWA.getTracker("1000123xxxx");
YWATracker.setAction("ADD_TO_CART");
YWATracker.setSKU("ABC1234");
YWATracker.setDocumentGroup("Product Pages");
YWATracker.setDocumentName("Demo Product");
YWATracker.submit();


To track multiple products added to the cart at the same time, you need to include the different SKUs with the setSKU method. Please use a semi-colon (;) as a separator for the different SKUs.



var YWATracker = YWA.getTracker("1000123xxxx");
YWATracker.setAction("ADD_TO_CART");
YWATracker.setSKU("ABC1234;DEF5678");
YWATracker.setDocumentGroup("Product Pages");
YWATracker.setDocumentName("Demo Product");
YWATracker.submit();


Conversion Action = A Yahoo! Web Analytics term used for an action defined by you and taken by a visitor on your website, e.g., completing a sale, visiting a specific page, submitting a form, downloading a file, subscribing to a newsletter, etc.
SKU (Stock Keeping Unit) = A unique product identifier. Yahoo! Web Analytics tracks products by their SKU information. The SKU is a number associated with a product for inventory purposes, and each product must have a unique SKU.

Was this information helpful?      

My Help

Forgot your ID or password?

Sign In

Sign in to see your account information saved articles and more.
  1. Recent Searches (0)

  2. Saved Articles