Google Analytics Ecommerce Tracking: Why You Need It and How to Set It Up

You’re familiar with the different reports that Google Analytics gives you but you may be less familiar with the Google Analytics Ecommerce functionality that you’re missing out on.

By bringing your ecommerce data into Google Analytics, you start to get a complete picture of how your marketing is performing and how to improve.

Imagine seeing which traffic sources actually led to orders or which traffic sources ended up adding products to their cart but not buying. All this is possible by enabling “ecommerce tracking” in Google Analytics.

Let’s start by looking at what ecommerce tracking is and what the new reports look like.

What is Ecommerce Tracking in Google Analytics?

Ecommerce tracking is the name of the functionality that Google Analytics offers to ecommerce stores.

In short, it lets you send data such as:

  • Order amount
  • Products bought in an order
  • Quantity of products bought in an order
  • Coupons
  • Categories of products
  • Currency

Google Analytics then takes this data and creates awesome reports for you. For example, this is what the “Overview” of the Ecommerce section in Google Analytics looks like:



You can instantly see metrics like:

  • Revenue
  • Ecommerce Conversion Rate
  • Number of transactions
  • Average Order Value

The real power from ecommerce tracking isn’t found here though. It is found when you go to popular reports like Acquisition:



You can instantly see which traffic sources are actually making you money and which ones aren’t. Orders are the ultimate conversion for stores and this is the best way to show it inside Google Analytics.

Enabling and setting ecommerce tracking also give you a few other new reports such as:

a) Shopping Behavior: this report shows you how many sessions took a specific action like adding a product to a cart or checked out.



b) Checkout Behavior: This is your classic funnel report for your ecommerce checkout.



c) Product Performance: this reports let’s you see how individual products perform and what are your most popular products by revenue, sales, etc.


d) Sales Performance: this report shows you individual sales/transactions.



Product List Performance: this report shows you the performance of categories or lists of product within your website.



Some of these reports will duplicate what you already see from your ecommerce software like Shopify or Magento. That’s fine.

We are more interested in taking our order data and combining it with our marketing traffic since that’s where Google Analytics excels.

Let’s look at how we can get Google Analytics Ecommerce set up with our store.

How to Set Up Google Analytics Ecommerce Tracking

Ecommerce tracking isn’t set up by default and it can be quite tricky to set it up if you aren’t a developer. Lucky for us, there’s a few options that will simplify the whole process.

I’ll cover 3 options and I’ll start with the easiest first.

Option 1: Using Plugins with Popular Shopping Carts

If you use a popular shopping cart then you probably just need a plugin or module that will do all the heavy lifting for you. I included a list of popular shopping carts below and links to the help article that will walk you through this setup process. For most of them, you simply install the plugin and then connect your Google Analytics account.

If you don’t see your shopping cart above, don’t worry. I couldn’t include the hundreds of options out there but you can see if your software has this option by searching “software name google analytics ecommerce tracking”. You could also try emailing support and asking for help.

Option 2: Google Tag Manager

If you are currently using Google Tag Manager (and if you aren’t, read this article on why you should) then you will able to use the data layer to set up ecommerce tracking.

There’s a few steps involved here so I will let the awesome Himanshu Sharma guide you through all the steps.

Option 3: Manually Firing Javascript Code

The third option is to simply fire your own Javascript code with the correct information. This is much easier than what it sounds.

This option requires 3 steps which look like this:

1) You start by loading the loading the ecommerce plugin using this command:

ga('require', 'ecommerce');

Make sure to fire this command after the Google Analytics tracker has loaded so after this line:

 ga('create', 'UA-XXXXXXXX-1', 'auto');

2) Now that we loaded the ecommerce plugin, we create a transaction. A transaction is an order by a specific user. Users can have multiple transactions i.e. multiple orders. The code looks like this:

ga('ecommerce:addTransaction', {
'id': '1234', // Transaction ID. Required.
'affiliation': 'Acme Clothing', // Affiliation or store name.
'revenue': '11.99', // Grand Total.
'shipping': '5', // Shipping.
'tax': '1.29' // Tax.

Note that each transaction needs a unique ID. This usually comes from your shopping cart or your database.

3) Once we have our transaction, we can add all the items that are found inside this order. We can do that by using this code:

ga('ecommerce:addItem', {
'id': '1234', // Transaction ID. Required.
'name': 'Fluffy Pink Bunnies', // Product name. Required.
'sku': 'DD23444', // SKU/code.
'category': 'Party Toys', // Category or variation.
'price': '11.99', // Unit price.
'quantity': '1' // Quantity.

The ID here matches the ID of the transaction we created since this is what Google Analytics uses to keep track of things. You would fire this code for every item inside an order but with different information for each item.

4) Once you are done building your transaction and adding items, we can send it to Google Analytics. We do that by firing this command:


Ideally, you should fire these commands after a user successfully completes their purchase.

The last step is to simply enable ecommerce tracking in your Google Analytics dashboard.

Enabling Ecommerce Tracking in Google Analytics

You enable ecommerce tracking on individual Views. You start by switching the status to ON and then clicking “Next Step”.



You will see a few options like “Related Products” and funnel steps. This is part of the “Enhanced Ecommerce” within Google Analytics which requires extra setup. If you use a popular shopping cart, it is most likely already set up for you.

Let’s now look at how we can take our ecommerce data and combine it with other reports.

Improved Google Analytics Reports with Ecommerce Data

Now that we have ecommerce data, we can look at a few common reports and see how they change.

Device Category with Ecommerce Data: this report will help you understand how well your website performs in mobile, tablet and desktop devices. You can then decide if you should spend more resources improving your mobile website.



Ecommerce Conversion Rate by Browser: this report can shows you the ecommerce conversion rate broken down by browser. It can help you catch technical errors that you may not see especially if most of the employees at your company use the same browser e.g. Chrome.



Traffic Sources with Ecommerce Data: this report shows you your traffic sources with ecommerce data. Which traffic source is converting at the highest rate? Which traffic source is making you money? You could combine this report to optimize your Facebook Ads for example.



Google Analytics Ecommerce Tracking will help you tackle the most important question for any business: how can I improve what is working and how can I stop doing what is not working?

If you have any questions, let me know in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *