Announcement

Collapse
No announcement yet.

Google Analytics Ecommerce tracks quantity wrong

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

    Google Analytics Ecommerce tracks quantity wrong

    Hi, I've searched this forum seemingly endlessly trying to find someone who has the same problem as me but no luck, so apologies if this has already been posted...

    I've set up Analytics and Ecommerce. Analytics is perfect and the Ecommerce is great... except... 99% of the time Google returns 1 Unique Purchase but with a Quantity of 11! See here...



    This is the code I have on my overall layout. Does anyone know if this is wrong?

    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-XXXXXXX-3");
    pageTracker._initData();
    pageTracker._trackPageview();
    <actinic:block if="%28%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22%29">
    	
    	  pageTracker._addTrans(
        "<actinic:variable name="OrderNumberOnlineXML" />",        // Order ID
        "",                            // Affiliation
        "<actinic:variable name="CartTotalPrice" />",              // Total
        "<actinic:variable name="Tax1" />",                        // Tax
        "<actinic:variable name="CartShippingHandling" />",        // Shipping
        "<actinic:variable name="Address2" />",                    // City
        "<actinic:variable name="Address3" />",                    // State
        "<actinic:variable name="Address4" />"                     // Country
      );
    
      pageTracker._addItem(
        "<actinic:variable name="OrderNumberOnlineXML" />",        // Order ID
        "<actinic:variable name="ReferenceCaption" />",            // SKU
        "<actinic:variable name="ProductNameOnline" />",           // Product Name 
        "",                            // Category
        "<actinic:variable name="ITEMPRICE" />",                   // Price
        "<actinic:variable name="Quantity" />"                     // Quantity
      );
      
      pageTracker._trackTrans();
    
    </actinic:block>
    } catch(err) {}</script>
    Many thanks,
    James.

    #2
    Well I've found out the reason behind this but still can't seem to solve the problem. The quantity of 11 occurs when a customer adds a component to an order, where components aren't available or not selected, the correct quantity appears.
    I've tried changing the code numerous times but still no luck.

    Any bright spark got an idea?

    Thanks,
    James.

    Comment


      #3
      As actinic links component quantity to product quantity and they are not independent, perhaps buying 1 product with 1 component is somehow getting read as 11.

      My first 2 ports of call would be whether any of the layout options (separate order line etc.) afforded to you on the component solve this (i fear not on this one).

      My second attempt would be to do the hack already detailed in both the KB and the forum which removes the component quantity from the shopping cart summary. Perhaps that will solve it.

      Comment

      Working...
      X