Announcement

Collapse
No announcement yet.

Analytics

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

    Analytics

    Hello,

    THere have been several threads posted about inserting tracking cookies & I've managed to do mine without too much hassle. I haven't, however, had eCommerce tracking running and would like to add it.

    I'm told I have to add:

    <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">
    var pageTracker = _gat._getTracker("UA-XXXXX-1");
    pageTracker._initData();
    pageTracker._trackPageview();

    pageTracker._addTrans(
    "1234", // Order ID
    "Mountain View", // Affiliation
    "11.99", // Total
    "1.29", // Tax
    "5", // Shipping
    "San Jose", // City
    "California", // State
    "USA" // Country
    );

    pageTracker._addItem(
    "1234", // Order ID
    "DD44", // SKU
    "T-Shirt", // Product Name
    "Green Medium", // Category
    "11.99", // Price
    "1" // Quantity


    But what are the variables I replace the example figures with?

    I have looked at other posts but they seem to refer to a legacy version of Google Analytics and that's why I'm asking again.

    Sam

    #2
    You can get the updated code and variables from V9

    Comment


      #3
      Originally posted by goddard@stjames View Post
      I have looked at other posts but they seem to refer to a legacy version of Google Analytics and that's why I'm asking again.

      Sam
      Sam try the following

      add

      <script type="text/javascript">
      <!--
      var act_order, act_item, act_ordernumber, act_productname, act_price, rConverDot, rRemoveEncoded;
      act_item = "";
      act_ordernumber = "<actinic:variable name="TheOrderNumber" />";
      rConverDot = new RegExp(".", "g");
      rRemoveEncoded = new RegExp("&#\\d*;", "g");
      //-->
      </script>

      just before </head> in the receipt page design (Version 8)

      Then add

      <script type="text/javascript">
      var pageTracker = _gat._getTracker("AA-1234567-1");
      pageTracker._initData();
      pageTracker._trackPageview();

      eval(act_order);

      eval(act_item);

      pageTracker._trackTrans();
      </script>

      just before </body> Change the AA-1234567-1 to your own analytics user code. This code assumes you already have the goal tracking code present.

      I got this from version 9 and I am testing it on a site at present.

      Malcolm

      SellerDeck Accredited Partner,
      SellerDeck 2016 Extensions, and
      Custom Packages

      Comment

      Working...
      X