Up and running in 5 mins


http://online-behavior.com/googleanalytics/tracking-ecommerce 24:00

Be very careful with Google's requirements. You must have an SKU, and it must be unique. Commas in a number will be read as decimal points. Currency signs create problems. Don't use them.

Some common issues include non-unique SKUs. JS errors, programming errors, reloads of receipt page, and users who have JS or cookies turned off.

The below code is for CartThrob and ExpressionEngine.

{exp:weblog:entries weblog="orders" limit="1" parse="inward" disable="categories|member_data|pagination|trackbacks" entry_id="{embed:entry_id}"}

    {!-- <!-- 
        Google Analytics tracking code
     --> --}
    <script type="text/javascript"> 
    '{entry_id}',               // order ID - required
    'Client Site',              // affiliation or store name
    '{order_total}',            // total - required
    '{order_tax}',              // tax
    '{order_shipping}',         // shipping
    '{order_billing_city}',     // city
    '{order_billing_state}',    // state or province
    '{order_billing_country}'   // country

    // add item might be called for every item in the shopping cart
    // where your ecommerce engine loops through each item in the cart and
    // prints out _addItem for each 
    '{entry_id}',               // order ID - required
    '{item:title}',             // SKU/code
    '{item:products_title}',    // product name
    '{item:size}',              // category or variation
    '{item:price}',             // unit price - required
    '{item:quantity}'           // quantity - required

    _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers