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>
The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video Conferencing and social media domain. The motive of creating cutehits was just to share the knowledge/solutions I get to know during my day to day life so that if possible I can help someone for same problems/solutions. CuteHits.com is a really a very effort for sharing knowledge to rest of the world. For any query/suggestion about same you can contact me on below details:- Email: shekharmca2005 at gmail.com Phone: +91-9560201363

Latest posts by Chandra Shekhar (see all)

You may also like...