woothemes/woocommerce — pull request #1316 by maxrice (2012-07-29 20:43:19+00:00)
Title: add google analytics event tracking for add to cart

Revised implementation of GA event tracking after feedback on #1315. Adds jQuery .click bind on add to cart buttons on both single product pages and loop pages. No new markup and no additional HTTP requests needed. Also added a disable_tracking function to reduce duplicate code -- could use this to refactor the rest of the google analytics integration in the future.

The loop add to cart event is somewhat fragile, as it relies on the product name existing with

tags.

new filter:
woocommerce_ga_event_tracking_parameters - allows change of category,
action, or label parameters included in _trackEvent

closes #1256