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();