Google E-Commerce integration guide

 

Google E-Commerce tracking is an efficient way to track your complete ecommerce transactions with google analytics. By implementing this method you can track your maximum information . With this tutorial you will learn “How to integrate Google E-Commerce Tracking with your website“.In order to integrate you must have your Google Analytics setup and E-commerce tracking should be enabled from there. Below are the steps to Enable E-Commerce tracking from Google Analytics

Step 1: Login to Google Analytics and then click on “Home” tab
Stpe 2: Click on “admin” tab coming on right side
Step 3: From this page select “Profiles ” tab
Step 4: Then select and click on your website profile
Step 5: On the new page click on “profile settings
Step 6: On this page under “E-Commerce Settings” select the option for “E-Commerce tracking option” selection option “Yes an ecommerce site

Now Click on save button.

Now add below code to your success file. Below are the example code snippet is recommend by Google E Commerce Tracking .


<html>
<head>
<title>Receipt for your clothing purchase from 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 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
_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 to the 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 you for your order.  You will receive an email containing all your order details.
</body>
</html>

Related posts:

The following two tabs change content below.

Chandra Shekhar

Consultant at Infogain
Chandra Shekhar is a LAMP Developer,Thinker,Blogger and currently working as Magento(Ecommerce) specialist.. I am always open to learn new things in LAMP as well as other newer technology. In the journey of my last 9 years of web and product development, I have decided to share my knowledge and experience to Open Source Community in 2011. In this regard I have started CuteHits.com. Since then I am actively sharing my knowledge on various LAMP technology through CuteHits.com’s technical ... Read More about Chandra Shekhar