No announcement yet.

Google Analytics Ecommerce - HELP?!

  • Filter
  • Time
  • Show
Clear All
new posts

  • Google Analytics Ecommerce - HELP?!

    Hi guys,

    Have any of you successfully implemented the Ecommerce functions of Google Analytics to track detailed info about your sales funnel and conversions?

    We've been having issues with this since we first set it up but we had a bit of a break through this afternoon. NOW, we know that our GA code is in all the right places according to the 3dcart KB and Google's help files and we've checked the syntax till we're cross eyed - it looks good.

    The GA ecommerce code sits only in the footer of the Checkout#4 page which feeds into the Checkout_thankyou.asp page.

    The problem is that part of the GA ecommerce code IS pulling data from the variable fields and another part of the ecommerce code is NOT pulling the data.

    Please see the attached screen cap for a super simple example of what I'm talking about.

    I am also pasting the HTML of the code from the footer so you can see that it has the proper syntax.

    I would REALLY appreciate anyone's help in wrapping up this issue once and for all. And please let me know if you see any syntax errors or typos in the code below.



    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-XXXXXXX-X");
    pageTracker._addTrans("[invoice-number]", "[discounts]", "[subtotal]", "", "[shipping]", "[ocity]", "[ostate]", "[ocountry]");
    pageTracker._addItem("[invoice-number]", "[id]", "[itemname]", "", "[unitprice]", "[numitems]");
    } catch(err) {}</script>
    Attached Files

  • #2
    I think you are adding more code than you need...

    That's the step by step setup, I think the Google Analytics screens changed a little, but, the part I think you may have wrong is the part on the 3dCart side.

    See page 5 of that guide, specifically, all you need to do to track conversions is on the checkout4 (thank you page), add the line of code:

    HTML Code:
    <script src="googleanalytics.asp?orderid=[orderid]" type="text/javascript"></script>
    That's it, (copy paste exactly as it is) on the footer section of the checkout4.

    If you followed the instructions on the previous page to copy/paste the tracking code on the global header, you should be all set.

    We spent a great deal of time creating this tool which writes the javascript for you, it passes the customer location, items purchased, etc, so you will be able to use all the cool tools within GA to track your sales.

    Please try that and post back your findings, we do get quite a bit of confusion over the integration because you are trying to do the javascript code yourself when its already done for you in the right format and all you have to do is copy that 1 line of code..
    Gonzalo Gil
    3dCart Support
    800-828-6650 x111


    • #3
      Thanks for your quick response, Gonzalo. We have made the change per your instructions and will wait the requisite 24-48 hours for GA to catch up so we can review the results.

      As requested, we'll be sure to post here as soon as we know how it's going.



      • #4
        Great, yeah, i wish there wasn't a delay, I think once Yahoo's free web analytics tool becomes available to everyone (, which works in real time, Google will update its tool to show real time as well :).

        The tricky thing too is that with Javascript, any script that runs into an error will stop all scripts below it from working, so, if you get to checkout4 during a test order and see a javascript error you are going to want to fix that. Make sure that all scripts are working, unfortunately the best way to find the issue is to start taking them out one at a time, unless you know Javascript and can use the debugging tool to get right to the source of the issue.

        Do let us know if everything worked out. If you followed the steps and it doesn't work for you, I can get one of our support staff to check it out for you, but 9 times out of 10 its the script not installed, installed on the wrong place, etc.
        Gonzalo Gil
        3dCart Support
        800-828-6650 x111


        • #5
          Very happy to report that all the basic GA ecommerce functions are now working properly. Still having some issues with funnels and goals working sporadically and having some work and others not even though they are coded exactly the same but that's for another time, and I"m pretty sure isn't a 3dcart issue.

          The important thing is that, in general, it's working fine. And boy do you get a lot of cool data when it is working.

          To fill in some background about this thread...we have a long and varied history with Google Analytics - some good, some bad. But we learned how to use it from Google's own help files and training. This is what caused much of the problem with getting it working properly with 3dcart.

          In different places in 3dcart's instructions for using GA, there are contradictions with Google's own instructions. Because we had a set way of doing things with GA, implementing properly in 3dcart became a challenge.

          It wasn't until Gonzalo's message in this thread where he said the following that it finally all fell into place:

          We spent a great deal of time creating this tool which writes the javascript for you, it passes the customer location, items purchased, etc, so you will be able to use all the cool tools within GA to track your sales.
          Ahhhh - so 3dcart is doing something SPECIAL. Though it's not mentioned anywhere that I can find in 3dcart's documentation, 3dcart has actually done some programatic work to facilitate using GA. It's this fact, left out of the 3dcart help files, that would have made the contradictions with GA's own help files a non-issue. The reason one wouldn't do x, y, and z to implement GA as instructed in the GA help files is because 3dcart has already done a lot of it for you. Very good to know.

          So all the code you are used to adding here and there to get GA set up is replaced by the couple of lines shown in the 3dcart tutorials.

          There are ups and downs to this scenario. While I suppose it makes it easy to set up for folks not familiar with GA, it removes functionality that you'd otherwise have available to you for customization.

          For instance, if you were able to code it yourself, you could choose which sales total to pass to GA ecommerce - sale amount before discounts, sale amount after discounts, sale amount including shipping, sale amount not including shipping, with taxes or without taxes, etc. The way 3dcart does it, you get what they pass to GA for you.

          Like I said, there are ups and downs to it but the most important thing, besides the fact that it works, is that you know what you are, and are not, able to do and that you understand why what you think you're supposed to be doing to install GA ecommerce isn't working at 3dcart.