Announcement

Collapse
No announcement yet.

V7 - Setting up ecommerce with the *new* google code?

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

    V7 - Setting up ecommerce with the *new* google code?

    Hi,

    I've read through 'daves guide to GA with actinic' but it is using the old urchin code. Does anyone have a guide for the new google code?

    There are still tons of v7 sites out there so someone must have done it by now...?

    The 2 problems would seem to be
    1. Which actinic variables to use
    2. how to loop it so you get the stats per item


    Here is googles help on the subject:
    Google Analytics supports a client-side data collection technique for capturing e-commerce transactions. With some simple additions to your receipt page, Google Analytics can automatically detect and record transaction and product information. The required information is placed in a code snippet, which is parsed for transaction and product information.

    The format of the code snippet is as follows:

    <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-xxxxxx-1");
    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
    );

    pageTracker._trackTrans();
    </script>


    Note that everything in brackets should be replaced by actual values. Only integer values are allowed, and commas or periods indicate that fractions follow those values. The receipt page variables for e-commerce tracking should be populated by the shopping cart service itself. The Google Analytics tracking code doesn't write this information for the transaction.

    Somewhere in the receipt below the tracking code, call the _addTrans() and _addItem() functions. Begin with a call to _addTrans() to establish a transaction. _addTrans() takes the following arguments: Order ID,Affiliation, Total, Tax, Shipping, City, State, Country. For each item that the visitor purchases, call _addItem(). _addItem() takes the following arguments: Order ID, SKU or Code, Product Name, Category, Price, Quantity.

    If you need help in identifying the actual values to replace the variables with, please contact your shopping cart service or web development team.
    I've searched the whole actinic forum for the phrase "addTrans" and not one post came up so presumaby noone has posted how to do this yet...?
    John
Working...
X