Google Analytics ecommerce tracking is a feature through which you can track ecommerce data (like sales amount, number of orders, billing location, average order value, etc.) of a website/mobile app in Google Analytics.
If you run/manage an online store/app, you can’t just depend upon the analytics reports provided by your shopping cart. You need Google Analytics Ecommerce tracking set up for your website.
Only by using Google Analytics ecommerce trackingcan you correlate sales data with website usage data like sessions, bounce rate, traffic source/medium, landing pages, etc.
Such a type of correlation analysis is required to understand the performance of your landing pages and marketing campaigns. Otherwise, you may never know which landing pages or campaigns are driving sales and which are not.
With Google’s robust set of reports, we can understand which products sell well and what are the best products viewed or bought by the customers. You can also view revenue per transaction and the number of products per transaction, and all this information will help you make informed decisions about your sales and business.
Ecommerce tracking is essential not only to understand how your products and website are performing but also helps to understand the path and variables that lead to successful conversions.
Step-7: Paste the Google Analytics tracking code on all the pages of your website (in the head section <head>…</head>). If you use a template file, paste the code in the header template file like header.php.
Step-8: Navigate to your website and then navigate to Real Time > Overview report in your Google Analytics account:
If you see the number of active users in your real time overview report, it means Google Analytics (GA) has been successfully installed on your website. However, if you see 0 number of active users, then it means GA tracking is not correctly installed:
Step-9: Navigate to Conversions > Ecommerce > Overview report:
Whenever you navigate to one of the ecommerce reports of a GA view for which ecommerce tracking is not enabled, you see the message “This report requires ecommerce tracking to be set up for the view“. You would need to enable Ecommerce reporting for each view in which you want to see the ecommerce data.
Step-10: Click on the ‘Admin’ link at the bottom left-hand side:
Step-11: Click on ‘Ecommerce Settings‘ under the view column:
Step-12: Switch on the ‘Enable Ecommerce’ toggle button and then click on the ‘Save’ button:
You have now successfully enabled Ecommerce reporting for your view. If you now navigate back to Conversions > Ecommerce > Overview report, you will no longer see the message “This report requires ecommerce tracking to be set up for the view“:
However, you still won’t see the ecommerce data because you have not installed the ecommerce tracking code on your website.
Just because you have enabled ecommerce tracking reporting in GA does not mean that you have also set up ecommerce tracking. All you have done so far is allowed your GA view to collect and report on ecommerce data.
Step-13: Integrate your shopping cart (like Shopify) with Google Analytics. Check the help documentation provided by your shopping cart for more details. Following is the help documentation for the most popular shopping carts:
Note: Shopping cart vendors generally won’t help you set up ecommerce tracking for your website. You would need to hire a developer (who has experience with the Google Analytics Development environment) to install ecommerce tracking for you.
ga(‘ecommerce:addItem’, { ‘id’: ‘1234’, // Transaction ID. Required. Same as in the transaction data. ‘name’: ‘OKEJeans’, // Product name. Required. ‘sku’: ‘SKJ49’, // Product SKU. ‘category’: ‘Men Jeans’, // Product Category or variation. ‘price’: ‘76.65’, // Product price. ‘quantity’: ‘1’ // Product Quantity. });
ga(‘ecommerce:send’);
This ecommerce tracking code is usually placed after the following line of code ga(‘create’, ‘UA-123456-12’, ‘auto’); and just before the following code ga(‘send’, ‘pageview’);.in the Google Analytics Tracking Code:
ga(‘ecommerce:addItem’, { ‘id’: ‘1234’, // Transaction ID. Required. Same as in the transaction data. ‘name’: ‘OKEJeans’, // Product name. Required. ‘sku’: ‘SKJ49’, // Product SKU. ‘category’: ‘Men Jeans’, // Product Category or variation. ‘price’: ‘76.65’, // Product price. ‘quantity’: ‘1’ // Product Quantity. });
ga(‘ecommerce:send’);
ga(‘send’, ‘pageview’);
</script>
Here the code in bold letters is the ecommerce tracking code. The rest is the Google Analytics tracking code.
However, this code is still not complete. To retrieve ecommerce data from your shopping cart, you need to add a server-side script to the code above.
Step-15: Ask your developer to add a server-side script (like PHP, ASP, etc.) to your commerce tracking code. Your server-side script should loop through all the products purchased in a transaction and send product data for each of them to the Google Analytics server.
So your actual ecommerce tracking code will look very different once the server-side script is added to it.
For example, here is what your ecommerce tracking may look like if you used PHP:
Note(1):Do not use this ecommerce tracking code on your website. It is just an example and is not even a complete code.
Note(2): The actual ecommerce tracking code will vary depending upon your CMS and shopping cart.
Step-16: Set up a funnel for your checkout process in Google Analytics. To do this, first determine all of the web pages which make up your shopping cart funnel (including the URL of the order confirmation page).
Transaction (or ecommerce transaction) is a purchase order.
For example, 1,736 transactions mean 1,736 purchase orders were placed on the website.
The ecommerce overview report shows the total number of transactions carried out on the website in a specified time period. Each transaction is identified through a unique ID known as the transaction ID.
Here, 4419144621 is a transaction ID.
A single transaction can include several products or several units of the same product because a person can buy several products in one transaction or several units of the same product in one transaction. For example, a person can buy an iPhone and an iPad in a single transaction, or a person can buy ten units (or pieces) of an iPhone in a single transaction.
Note: The value of transaction ID is of type ‘string’.
Revenue
The revenue that you see in the Ecommerce Overview report is the total revenue.
Total Revenue = Total Product Revenue + Total Tax + Total Shipping
For example, the total revenue in the Ecommerce Overview report was calculated as follows:
Your total revenue figure in the Ecommerce Overview report depends upon how the ecommerce tracking has been set up.
If your client decided to exclude tax and shipping amount from the total revenue, then your total revenue and product revenue amount would be the same.
Suppose the tax information or shipping information is not supplied while setting up ecommerce tracking. In that case, Google Analytics can’t report such information in its reports, and they won’t be included in the computation of total revenue.
Note: The value of revenue is of type ‘currency’.
Average Order Value
The average value or average order value (AOV) is the average value of an ecommerce transaction.
Average Value = Total Revenue/Total Transactions
For example, the AOV in the chart above was calculated as:
AOV = $236,857.90 / 1,736 = $136.44
Note: The value of the Average Order Value is of type ‘currency’.
Unique Purchases
Unique purchase is the total number of times a product or a set of products was a part of a transaction.
There are two categories of unique purchases in Google Analytics:
#1 Total Unique purchases of a set of products
#2 Total Unique purchases of a product.
Note: The total unique purchases of a product are not equal to the total number of units sold for the product in one transaction. For example, the total unique purchases of the first product are 75.
But many people wrongly assume the 75 units of the first product were sold in one transaction. This is not the case.
The 75 figure tells you that the first product was a part of a transaction 75 times. It doesn’t tell you the number of units sold for the product in one transaction.
To find the number of units of a product that were sold in one transaction, follow the steps below:
Click on a product link in the ‘Product Performance’ report (under Conversions > Ecommerce).
Add ‘transaction ID’ as a ‘secondary dimension.
Sort the ‘Unique Purchases’ column in decreasing order.
You will now see a report like the one below:
Note: The value of Unique Purchases is of type ‘number’.
Per session value is the average value of a session of your ecommerce website.
Per session value = Total Revenue / Total Sessions
For example, in the chart above,
The per session value for all traffic sources is calculated as: $280,650.01 / 1,182,618 = $0.24
The per session value of the traffic from Google Organic is calculated as: $77,228.80 / 210,212 = $0.37
The higher the per session value, the more valuable the traffic is for your ecommerce business.
Note(1): You can determine per session value through ‘E-commerce’ Tabs found in various reports.
Note (2): The ‘per session value’ is of type ‘currency’
Where can you see ecommerce metrics in Google Analytics?
To view your ecommerce metrics in Google Analytics. follow the below steps:
Step-1: Login to your Google Analytics reports console.
Step-2: On the left-hand navigation bar, go to ‘Conversions’ and locate ‘E-commerce’ underneath it.
Under this subheading, you’ll be able to find the shopping and checkout behaviour of the users, transactional information, sales performance and how long it takes for the users to purchase on average.
Let us look at each tab individually and see what information it provides:
Overview Tab
This report provides you with a quick overview of what exactly is happening on the ecommerce side of your business. This report includes overall revenue, transactions, and avg order value.
Shopping Behaviour Analysis
This report provides an insight into how new vs returning visitors behave when shopping on your site. It also shows you how users progress through a sales funnel.
If we look at the report, you can notice that it all starts with ‘All sessions’ on the left-hand side, followed by product views, adding to cart, checking out and making a transaction.
You can view where exactly the users are getting dropped off in each stage.
You can use this report to analyze the pain points in the customer journey. For example, if you are noticing that users are mostly getting dropped off from a particular page, you can investigate the reason and work on improving the performance of the website.
The Checkout Behaviour Analysis
With the help of this report, you can analyze how exactly the users had moved from one step to another before they reached the checkout page. Like the shopping behaviour report, you have an option in this report that provides insights into the drop-off rate at each step.
Product Performance Report
The product performance report in your analytics gives valuable insights into how customers interact with your online products.
In this report, you have an option to view your report by product SKU, product name, product category or product brand. It gives detailed insights into how exactly each product is performing and what are top revenue-generating products.
Sales Performance Report
The sales performance tab shows sales and transactional information for individual product orders. This report provides key insights about your sales metrics like revenue, transactions delivery, refund amount etc.
Product List Performance
Product list performance gives you in-depth information on how each individual product or set performs. It allows you to track how clusters of data of products in your online store are performing.
How to Fix Common Issues with Ecommerce Tracking
Duplicate Transactions
Duplicate transactions in Google Analytics mean a single transaction is counted more than once.
If this is the case, it completely skews your complete reporting because, along with transactions, it also messes up revenue, quantity and other metrics. To fix this issue, ensure that the “_trackTrans” command is called only once per the transaction.
Make sure your thank you page loads only once or make sure the user can view this page only once and the transaction is counted only once.
Ecommerce Code Firing multiple times
There are chances that the users will bookmark the confirmation page and refresh the page in some cases. In such scenarios, the ecommerce code is fired multiple times and data is sent to Google analytics.
As a solution for this issue, we can set up a new field called ‘transaction flag’. Once the transaction is completed, this value should be set, and ecommerce data should be sent to Google Analytics. Then, the next time the user loads the confirmation page, if this value is already set, don’t send fire the ecommerce code.
Missing Transactions in Google Analytics
It is common that you would notice a discrepancy in transactions between your internal system and Google Analytics. However, if this discrepancy is more than 5%, you should investigate the reason for this issue.
There could be several reasons that you would see this issue.
Some coding languages will automatically insert commas for numeric values when writing numbers to web pages. For example, if the average cost of some product on your website is 1856rs, if it is written as 1,856rs, it will create a problem in Google Analytics reports.
In such cases, JavaScript would have issues parsing these values, which contain commas, into Google Analytics unless they are specified as a string.
To avoid this issue, we need to ensure that we do not add commas in the numeric values while sending data to Google Analytics.
Apart from these issues, there could be multiple issues with ecommerce implementation. One of the best ways to debug the issues is to use Google’s ecommerce troubleshooter. This tool helps you identify and resolve all the issues with your ecommerce tracking and reporting.
This troubleshooter provides you with an option to select the issue and provides possible workarounds to fix it.
The plugin contains the functionality for ecommerce tracking in GA. You have to load this plugin; otherwise, your ecommerce tracking won’t work.
Note: The ‘ecommerce’ command should always be called after you have created the tracker object and before the following commands are executed: ecommerce:addTransaction, ecommerce:addItem and ecommerce:send
‘ecommerce:addTransaction’ command
This command is used to create a visitor’s transaction and store all the transaction information.
This command is used to add a product to a visitor’s transaction and store all the information about the purchased product.
Syntax:
ga(‘ecommerce:addItem’, { ‘id’: ‘1234’, // Transaction ID. Required. Same as in the transaction data. ‘name’: ‘OKEJeans’, // Product name. Required. ‘sku’: ‘SKJ49’, // Product SKU. ‘category’: ‘Men Jeans’, // Product Category or variation. ‘price’: ‘76.65’, // Product price. ‘quantity’: ‘1’ // Product Quantity. });
‘ecommerce:send’ command
This command is used to send all of the ecommerce data to the Google Analytics server.
Syntax: ga(‘ecommerce:send’);
Note: without using the command, you can’t send ecommerce data to Google Analytics.
Important Points about Ecommerce Tracking in Google Analytics
#1 It is common to have data discrepancies between Google Analytics sales data and your shopping cart sales data.
All major pre-built shopping carts have the functionality to handle cancelled orders, test orders, promo/discount codes, unfulfilled orders and refunds (partial or full).
Google Analytics does not have any such in-built functionality.
Once a user is served an order confirmation page, the ecommerce tracking code is executed, and GA records the transaction. If the user later asks for a refund or cancels the order, or the order is not fulfilled, these changes don’t automatically reflect in GA ecommerce reports.
Thus depending upon the volume of cancelled orders, refunds and unfulfilled orders your website gets every day, you may see either small or large data discrepancies between GA sales data and your shopping cart sales data.
Remember, GA was never designed to function as accounting software. So do not expect 100% accuracy in sales data.
Since a shopping cart handles sales data much better than GA, trust your shopping cart data more whenever you are in doubt.
#2 Test orders can very easily skew your ecommerce data in Google Analytics
It is common for web developers to place test orders while testing an application. But it is not common for them to reverse test transactions in Google Analytics.
All the test orders need to be reversed; otherwise, they can greatly inflate your sales data.
Ask your developer to provide you with a list of all test orders placed on the website at least once a month and then at least deduct them from your analysis if you can’t reverse them.
If your website gets more than 250k sessions a month and you don’t use GA premium, there is a good possibility that your website is suffering from data sampling issues. When GA sample your data badly, you can’t trust the metrics reported by it.
Your ecommerce data from revenue to ecommerce conversion rate could be 10 to 80% off the mark.
This is a very common issue I encounter while doing a GA audit.
A duplicate transaction can occur when an ecommerce tracking code is executed more than once without placing any new order. Duplicate transactions can easily skew your ecommerce data.
Frequently Asked Questions About Google Analytics Ecommerce Tracking
Why do you need ecommerce tracking?
If you run/manage an online store/app, you can’t just depend upon the analytics reports provided by your shopping cart. You need Google Analytics Ecommerce tracking set up for your website. Using Google Analytics ecommerce tracking, can you correlate sales data with website usage data like sessions, bounce rate, traffic source/medium, landing pages, etc.
Such correlation analysis is required to understand the performance of your website landing pages and marketing campaigns. Otherwise, you may never know which landing pages or campaigns are driving sales and which are not.
What is ecommerce conversion rate?
Ecommerce conversion rate is the percentage of sessions which results in ecommerce transactions (in a given time period). Following is the formula to calculate the ecommerce conversion rate:
Transaction (or ecommerce transaction) is a purchase order. Each transaction is identified through a unique ID known as transaction ID.
A single transaction can include several products or several units of the same product. A person can buy several products in one transaction or several units of the same product in one transaction. For example, a person can buy an iPhone and an iPad in a single transaction or buy ten units (or pieces) of an iPhone in a single transaction.
What is average order value?
Average value or average order value (AOV) is the average value of an ecommerce transaction.
Average Value = Total Revenue/Total Transactions
For example, the AOV in the chart above was calculated as:
AOV = $236,857.90 / 1,736 = $136.44
What are unique purchases?
Unique purchase is the total number of times a product or a set of products was a part of a transaction.
There are two categories of unique purchases in Google Analytics: #1 Total Unique purchases of a set of products #2 Total Unique purchases of a product.
The total unique purchases of a product is not equal to the total number of units sold for the product in one transaction.
"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."
Here’s what we’re going to cover in this training…
#1 Why digital analytics is the key to online business success.
#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.
#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.
#4 Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.
#5 The number 1 reason why conversion optimization is not working for your business.
#6 How to advertise on any marketing platform for FREE with an unlimited budget.
#7 How to learn and master digital analytics and conversion optimization in record time.
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.
About the Author
Himanshu Sharma
Founder, OptimizeSmart.com
Over 15 years of experience in digital analytics and marketing
Author of four best-selling books on digital analytics and conversion optimization
Nominated for Digital Analytics Association Awards for Excellence
Runs one of the most popular blogs in the world on digital analytics
Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Allow Cookies”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.