Hi guys we recently had these 2 issues for a client (event tracking on add to cart and ecommerce tracking not working on completed purchases). Here is the fix we put in place.
The issue we found was Woocommerce was adding a <p> or </p> tag in the added woocommerce code. We modified the ecommerce_tracking_code( $order_id ) function found inside class-wc-google-analytics.php so the script that will be embedded in the page will not include the <p> tags. We were able to use the Google Analytics Debugger chrome extension you can download for free at https://goo.gl/umz7a to observe the purchases being tracked after purchase.
We also noticed an issue with the ‘Add to cart’ buttons not tracking events in Analytics. The only way we were able to resolve this was to put a 1.5 second delay on the push script. The delay was added in woocommerce push script so it will allow Analytics to push the events to Google. We ended up turning this off as the client didn’t really need it and didn’t want the delay.
Modified files:
/wp-content/plugins/woocommerce/classes/integrations/google-analytics/class-wc-google-analytics.php