E-commerce tracking in Google Analytics - what is it?
Ecommerce reports in Google Analytics inform you about transactions, order values, conversion rate, the total number of orders and in the case of Google Ads campaigns, about conversion bidding of campaigns, ad groups or keywords. It’s an essential part of every e-commerce web analytics. Thanks to having correct data about sales and user behavior you’re able to optimize your Google Ads campaigns, determine the effectiveness of your SEO activities or analyze different sources of traffic to the site. It’s worth using campaign goals to pick up any possible errors of the e-commerce module and to measure micro-conversion. Goals can be configured so that they provide you with the conversion value data, however, setting up e-commerce tracking provides much more comprehensive information. In today’s article, we’ll spill the beans and present you the easiest ways of implementing e-commerce tracking. Later, this blog post can serve you as a brief that will help your web developers to deploy the changes.How to turn on conversion tracking in GA?
Let’s assume that Google Analytics is properly implemented on every subpage of your website. You can turn on e-commerce conversion tracking by logging into your Google Analytics account, going to the administration tab in the data column, and clicking on e-commerce settings. Then, you’ll be redirected to an e-commerce setup where you need to enable e-commerce. Additionally, you can set up improved e-commerce which provides even more details about transactions, abandoned shopping carts, or shopping path analysis. Save the changes.How to implement e-commerce conversion tracking?
Once e-commerce tracking is enabled, Google Analytics will wait for your website to provide it with information about transactions or products. In order to send such information correctly, you need to implement a special javascript code that will send this dynamic data. For more instructions go to https://developers.google.com/analytics/ or namely to the e-commerce measurement documentation https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce When configuring the tag on the site, the web developer should provide transaction and product data. Such data layer should be included on each subpage finalizing the transaction or in some cases, on subpages that precede being redirected to a payment gateway. The code needs to be activated for each transaction and the data layer should be placed at the very top of your website structure, above the Google Tag Manager code.Transaction data
Variable name | Description | Value type |
---|---|---|
transactionld* | Unique transaction ID | Sequence of signs |
transactionAffiliation | The store or affiliation | Sequence of signs |
transactionTotal* | The total value of the transaction | Currency |
transactionShipping | The total shipping cost of the transaction | Currency |
transactionTax | The total tax cost of the transaction | Currency |
transaction Products | The list of objects purchased in the transaction | Table of objects |
Product data
Variable name | Description | Value type |
---|---|---|
name* | The name of the product | Sequence of signs |
sku* | The SKU code of the product | Sequence of signs |
category | The category of the product | Sequence of signs |
price* | The price for each product | Currency |
quantity* | The number of products purchased in the transaction | Integer |
An exemplary data layer code
<script>
window.dataLayer = window.dataLayer || []
dataLayer.push({
'transactionId': '1234',
'transactionAffiliation': 'Acme Clothes',
'transactionTotal': 38.26,
'transactionTax': 1.29,
'transactionShipping': 5,
'transactionProducts': [{
'sku': 'DD44',
'name': 'shirt',
'category': 'Clothes',
'price': 11.99,
'quantity': 1
},{
'sku': 'AA1243544',
'name': 'Socks',
'category': 'Clothes',
'price': 9.99,
'quantity': 2
}]
});
</script>
Data layer for transactions measured in Google Ads
<!-- Event snippet for Konwersja AdWords conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'AW-xxxxxx/xxxxxxxxxx',
'value': 0.0,
'currency': 'EUR',
'transaction_id': ''
});
</script>
How to check whether e-commerce tracking works properly?
In order to check whether the module has been implemented properly, go through the following stages:- Check your real-time orders. Place an order and check if the transaction displays in the REAL TIME tab. The delay shouldn’t take more than a few minutes. If the transaction isn’t shown in real time, wait 15 minutes and see whether it’s been recorded in CONVERSIONS > e-commerce > transactions from today. If the transaction still hasn't been recorded it may mean that the module doesn’t work properly.
- Check data from the previous month. Compare your data from Google Analytics with the sales data in your store. Usually, 10% (difference) is the acceptable value of error. If the difference is bigger, it may suggest that the tracking doesn’t work properly.
- Compare sales data with your supporting goals. We’d suggest you to create goals such as going to the shopping cart page, taking the last step in the shopping cart before being redirected to a payment gateway or the thank you page. This will help to identify where the error occurred. If the data from the thank you page corresponds to the number of transactions, then you can be sure that e-commerce tracking works properly.
- Whether the e-commerce script is called once or several times within the order path.
- Whether each payment operator redirects to the site with the e-commerce script installed.
- Whether the e-commerce script is called before or after the transaction.
- Whether test orders were included.
- Whether the e-commerce script has been implemented according to the current Google guidelines.
- Whether each subpage enables Google Analytics tracking and whether it's the latest tracking version.
- Whether the Google Analytics module in your CMS (if you use one) is up-to-date and has no errors.