Support » Plugin: WooCommerce » Google analytics ecommerce tracking on working with Woo Commerce

Viewing 15 replies - 16 through 30 (of 31 total)
  • There are some decent troubleshooting tips here (see bottom of post).

    Note the need to setup Goals before eCommerce transactions will display in Analytics.

    Hi Joey

    I have goals set up on my site however it is still not tracking sales using 2.0.10. Reverting to 2.0.5 worked out for me but obviously isn’t ideal.


    I’m going to take a look at 2.0.10. But I can attest that 2.0.12 is in fact working.


    Yep – it looks like Woo fixed a bug in class-wc-google-analytics.php sometime between 2.0.10 and 2.0.12 on line #217. In 2.0.10, they were sending an improper order ID to Google Analytics. I suggest you upgrade to 2.0.12.

    Joey – I’m glad ecommerce tracking is working for you on 2.0.12 🙂 I upgraded but it’s not working for me 🙁

    What version are the rest of you all using? Have you resolved your issues?


    Have you looked at the Google Analytics Debugger browser extension? If so, what’s being printed to your console?

    I have also upgraded to 2.0.12 and it still is not working unless I turn off the “WordPress SEO” plugin. Then it seems to work. Can it be a conflict with “WordPress SEO”?


    If you would, jump over to XD3V, scroll to the bottom, and send me your site’s URL through the contact form. I’ll be happy to take a quick look and help you troubleshoot.

    Just wanted to let everyone know that Joey went out of his way spending hours to help find a solution to my issue. It turns out that WordPress SEO Plugin (version 1.4.11 and later) was breaking some Google Analytics eCommerce because excerpts were disabled in my theme. He explains it in detail in this article on his web site. Thanks Joey!

    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 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:



    I’ve observed the second issue (Add to cart) you mention and found that event tracking was not succeeding when Add-to-cart button takes you directly to the checkout form instead of the cart page. Does that agree with the scenario you encountered?

    As for the first issue, I’m certainly not a fan of modifying any core Woo files and I’m left wondering: 1) what code did you change that resolved the issue, because the ecommerce_tracking_code() itself doesn’t include any <p> tags; 2) was it WordPress’ wpautop function that was actually inserting the tags and if so, is there a better way to correct the issue than changing the core files?

    Just my thoughts. Look forward to your response.

    Hey – I’m the client that Dan and the WPcurve team developed the fix for.

    I’d like to thank Dan publicly and give the WPcurve service my endorsement. I’d been chasing my tail for an age on this issue before asking for help. Just this one fix is worth more than my $69 monthly subscription.

    Fran Sanchez


    Hi guys,

    Did anyone found the issue yet? Is it in the class-wc-google-analytics.php file?

    My problem is that not all transactions are tracked, a handful of them are not, and I cant figure out why…

    @franco, there are various issues and largely depend on your theme. Can you post some details here or contact me over on

    I am having a similar issue. I’m using the WooCommerce plugin with a custom designed theme. I can see in the view source of the confirmation page that the Google Analytics code is firing and all of the order data is being captured, however, nothing is getting reported to Google. All of my other (non-transactional) analytics are working fine.

    Like some of the earlier posters, I see the <p> tags surrounding the analytics code. I don’t know if that is having an effect or not.

    I am running the latest version of the plugin.

    Any help is appreciated.

Viewing 15 replies - 16 through 30 (of 31 total)
  • The topic ‘Google analytics ecommerce tracking on working with Woo Commerce’ is closed to new replies.