Announcement

Collapse
No announcement yet.

New Google Analytics Code Not Working on 3dCart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • New Google Analytics Code Not Working on 3dCart

    Not long ago, after opening a Google Analytics account, you were offered 2 different code snippets - one ".js" based and one that was ".ga" based.

    Under 3dcart's direction we used the .ga code style. It worked fine. And, combined with the ecommerce snippet provided by 3dcart, it also gathered ecommerce data from our store.

    We recently had to change Google Analytics accounts and now they only provide a .ga code (NEW code) BUT it's constructed completely differently from what the old .ga code looked like.

    And now the ecommerce tie-in with 3dcart does not work.

    We tried putting back in the old Analytics code and substituting in our new account number in place of the old account number and that doesn't work either - as a matter of fact, doing that stopped Analytics from tracking anything at all.

    Has anyone opened a new Google Analytics account lately and had problems getting ecommerce to work on 3dcart? Or is it working for you and if so...any suggestions?

    Thanks.

  • #2
    Try this:

    HTML Code:
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try{
    var pageTracker = _gat._getTracker("UA-xxxxxx-x");
    pageTracker._trackPageview();
    } catch(err) {}</script>
    Where UA-XXXX = your google UA account info you can keep that from your other script.
    ----------------------------
    Gonzalo Gil
    3dCart Support
    800-828-6650 x111

    Comment


    • #3
      Originally posted by GonzaloGil View Post
      Where UA-XXXX = your google UA account info you can keep that from your other script.
      We actually already tried that but it doesn't work. (The code you put here is the "old" code from Google that we were using previously.)

      Analytics stopped tracking traffic completely when I put back this "old" Google code but substituted our new UA number.

      Comment


      • #4
        I just tested this out (setup a test Google Analytics account, copied and pasted the code word for word that i gave on a previous post, changing the UA number), and Google didn't seem to have any issues. I wish it was instant, but as you know it takes a bit to get data showing on the reports. I am going to wait a day and see what happens, but so far:


        Website URL: http://201073128479.3dcart.net
        Web Property ID : UA-17457794-1
        Tracking Status: Waiting for Data
        Analytics has been successfully installed and data is being gathered now.

        I don't see why it would say that if it didn't like the code, but we'll see what happens tomorrow.

        By chance, did you try keeping the code for a full 24 hours before removing it?

        Will report back in a day or so once it had a chance to send back stats.
        ----------------------------
        Gonzalo Gil
        3dCart Support
        800-828-6650 x111

        Comment


        • #5
          Well, took less than i expected, the tracking code is already reporting visitors:


          Site Usage

          1 Visits

          1 Pageviews

          1.00 Pages/Visit

          100.00% % New Visits


          So, with certainty, the code i gave you works, now, the only possibility is that when you placed yours, your placed it in an incorrect section of the page. I suggest looking at the PDF we have on the subject as it outlines step by step what needs to be done.

          Link to Pdf
          ----------------------------
          Gonzalo Gil
          3dCart Support
          800-828-6650 x111

          Comment


          • #6
            Originally posted by GonzaloGil View Post
            By chance, did you try keeping the code for a full 24 hours before removing it?
            Yeah, we did keep the code for a full 24 hours. Analytics also told us that we had 1 visitor.....but only 1 for the entire 24 hours! We know for sure that that's wrong!

            Comment


            • #7
              Originally posted by GonzaloGil View Post
              So, with certainty, the code i gave you works, now, the only possibility is that when you placed yours, your placed it in an incorrect section of the page. I suggest looking at the PDF we have on the subject as it outlines step by step what needs to be done.
              No, that's not the solution because I put the code EXACTLY where it was before which is EXACTLY where it says in the PDF to put it. Just before </head>

              Comment


              • #8
                Oh, and Analytics didn't seem to have a problems with the replacement of the "old" code. It didn't come up with any error messages or notifications and it still said it was receiving data.

                I know it wasn't working properly because it was not actually gathering any data. It thought it was, but it wasn't. We had many more visits than 1 yesterday.

                Since replacing (again) the "old" code with the "new" code, traffic is now being tracked properly in Analytics. However, eCommerce data is still not being gathered.

                Comment


                • #9
                  Well, i just checked:

                  Site Usage

                  4 Visits

                  36 Pageviews

                  9.00 Pages/Visit

                  0.00% Bounce Rate

                  00:05:55 Avg. Time on Site

                  100.00% % New Visits

                  So, its not that it showed 1 by fluke, its certainly working.

                  Now, looking at the pdf, it says to place the code on the global left section. I think its time to re-download the PDF, you may have printed a very old version, the one i linked never asks for placing it before the HEAD tag. In my case i put it on the global footer, I don't think it matters as long as its in one of the 4 boxes and that when you go to the store and view the store source code its displaying.

                  If you do this and it doesn't work for you, its time to contact Google because the issue is not on 3dcart's side. The fact that i was able to do this just now tells me that the placement of the tag is 99.9% the cause of the issue as we have quite a bit of merchants using this feature.
                  ----------------------------
                  Gonzalo Gil
                  3dCart Support
                  800-828-6650 x111

                  Comment


                  • #10
                    eCommerce still not working

                    Gonzalo,

                    I made the changes just as you suggested. I took the code you gave, replaced our UA number, and put the code in the Global Footer. I have left it for 24 hours and while Analytics does now seem to be gathering the data for visits etc, the eCommerce side of things is STILL not working.

                    The only reason I switched back to the "old" Analytics code was in the hopes that our transactions would be captured by eCommerce.

                    I was told by Tech Support that the "updated conversion code from Google is not yet compatible with our cart, which is likely the case of the problem", but you said that it works for other merchants.........

                    Comment


                    • #11
                      Ok, so, as i expected, the code works. Great. Part #1 solved.

                      Part #2 - The tracking script, now we need to ensure that's in place correctly.

                      What i see here is that you have the script on the footer, (very bottom of the page), and so whats going to happen when you go to checkout 4 (thank you page) is the following:

                      TOP OF PAGE
                      [CODE FOR ITEMS] will print
                      [CODE FOR STATS] will print
                      BOTTOM OF PAGE

                      This is not good as the code for the items must be placed AFTER the stats code. This is why on the PDF we ask that you place it on the LEFT banner section and not the footer. (Left banner is higher than the bottom of the page)

                      If you would like either a) Follow the directions on the PDF, or, b) take the code, remove it from the footer and edit your FRAME.HTML and place it somewhere near the top of the page, perhaps right after <Body> tag.

                      Regarding the support request, they are correct, the new code that Google implemented does not work with the code that we have for the e-commerce tracking (as i and multiple support reps outlined to you in the past 2-3 tickets you placed regarding the issue), however, following the steps on the PDF will still works, and its the recommended way to use this plugin.
                      ----------------------------
                      Gonzalo Gil
                      3dCart Support
                      800-828-6650 x111

                      Comment


                      • #12
                        Originally posted by GonzaloGil View Post
                        What i see here is that you have the script on the footer, (very bottom of the page), and so whats going to happen when you go to checkout 4 (thank you page) is the following:

                        TOP OF PAGE
                        [CODE FOR ITEMS] will print
                        [CODE FOR STATS] will print
                        BOTTOM OF PAGE

                        This is not good as the code for the items must be placed AFTER the stats code. This is why on the PDF we ask that you place it on the LEFT banner section and not the footer. (Left banner is higher than the bottom of the page)

                        If you would like either a) Follow the directions on the PDF, or, b) take the code, remove it from the footer and edit your FRAME.HTML and place it somewhere near the top of the page, perhaps right after <Body> tag.
                        OK, wait, I'm a bit confused. Are you telling me that the Analytics code is in the wrong place, or the eCommerce code (the one line of HTML provided by 3dCart)? The eCommerce code is in the footer of Checkout 4 as it says in the PDF.

                        I put the Analytics code in the Global Footer because that is where you told me that you put it and you had said it worked and you thought it was fine there.

                        Before I started the process of submitting a Ticket and posting on the Forum, I already HAD this code in the frame.html. I had it just before the </head> tag. When I had it there it didn't work at all.

                        However, in the interest of trying everything, I will put the Analytics code back into the frame.html and we'll see if somehow it works this time....

                        ...I'll let you know.....

                        Comment


                        • #13
                          The PDF that explains how to install the Google Analytics plugin asks you to put it on the LEFT bar. While placing it on the footer will work also, the tracking script may not work correctly if you do it that way.

                          What you need to make sure is that the page tracking code (the code i pasted earlier) is HIGHER on the page than the eCommerce tracking code (which you should have copy & pasted from the PDF onto your checkout 4 (thank you page) footer section)

                          How you place the code on the page is up to you, if you want to follow the PDF, put it on the LEFT bar, if you want to do it via editing the frame.html you can do it that way, just be sure that:

                          a) When you view source of any page of your site the page tracking code is visible.
                          b) Go through checkout and the ecommerce tracking script displays on the page AFTER the page tracking code not before.

                          (Sounds very complex, but following the PDF word for word accomplishes this without having to understand the reason behind it all).
                          ----------------------------
                          Gonzalo Gil
                          3dCart Support
                          800-828-6650 x111

                          Comment


                          • #14
                            Just saw your site and the page tracking script is perfectly placed now.

                            I can't check the other script right now as it would mean i have to checkout, but, if you followed the instructions on the PDF, it should work now. If your next sale does not show up in analytics within 24 hours, let me know, I will personally check into this for you. (feel free to email me directly gil @ 3dcart.com)
                            ----------------------------
                            Gonzalo Gil
                            3dCart Support
                            800-828-6650 x111

                            Comment


                            • #15
                              Thanks for checking up on the code placement. I have been monitoring Analytics and eCommerce for the last (almost) week and it finally seems to be working almost normally.

                              I did just check the eCommerce stats and compared them with actual sales, and noticed that eCommerce did not pick up 4 of the sales. I went back to 3dCart to check and see if there were any similarities between these sales, and saw that they all used the PayPal option to check out, not credit card.

                              HOWEVER, there were some sales that used PayPal that DID get picked up by eCommerce. The sales that eCommerce registered that used PayPal got to the "paymentreceive.asp?oid=4373&gw=paypal" page AFTER "checkout_one.asp". All the others seemed to stop at "checkout_one.asp". Although the sales did go through, they did not reach that final page.

                              Do you have any thoughts as to why they didn't reach that final page? Is there a way to force them through to that page so Analytics and eCommerce can track more efficiently?

                              Thanks!

                              Comment

                              Working...
                              X