e commerce - Google Analytics Ecommerce Tracking Modifications? -


looking @ adding google analytics e-commerce tracking website running on closed source e-commerce platform. google have given code example in system:

<html> <head> <title>receipt clothing purchase acme clothing</title> <script type="text/javascript">    var _gaq = _gaq || [];   _gaq.push(['_setaccount', 'ua-xxxxx-x']);   _gaq.push(['_trackpageview']);   _gaq.push(['_addtrans',     '1234',           // transaction id - required     'acme clothing',  // affiliation or store name     '11.99',          // total - required     '1.29',           // tax     '5',              // shipping     'san jose',       // city     'california',     // state or province     'usa'             // country   ]);     // add item might called every item in shopping cart    // ecommerce engine loops through each item in cart ,    // prints out _additem each   _gaq.push(['_additem',     '1234',           // transaction id - required     'dd44',           // sku/code - required     't-shirt',        // product name     'green medium',   // category or variation     '11.99',          // unit price - required     '1'               // quantity - required   ]);   _gaq.push(['_tracktrans']); //submits transaction analytics servers    (function() {     var ga = document.createelement('script'); ga.type = 'text/javascript'; ga.async = true;     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';     var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(ga, s);   })();  </script> </head> <body>    thank order.  receive email containing order details.  </body> </html> 

would placed onto final sale page or need data? unsure have never done before, site running on php/mysql scripts.

to implement ga ecommerce tracking, you'll need know cart variable names (ordertotal, orderarray, etc - varies every cart platform) , how insert them script when thank-you page rendered, customer's order has correct details.

generally, you'd insert of addtrans variables, perform loop (one pass each item in cart) additem. but, details of depend on cart, can't more specific that.

depending on size/savvy of cart's community, may able find pre-cooked example can drop onto thank-you page template, or may have built in module.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -