Ecommerce Tracking in Universal Analytics

By Megalytic Staff - June 20, 2014

Sites upgrading to Universal Analytics have three choices for implementing Ecommerce tracking.

1. You can leave your tracking code as-is.
2. You can upgrade to Universal Analytics tracking.
3. You can upgrade to Enhanced Ecommerce for Google Analytics.

In this post, we look at the pros and cons of each choice and help you navigate the options to make the best decision for your Ecommerce site.

Ecommerce in hand

The Two Components of Google Analytics - and What it Means for Ecommerce

There are two components of Google Analytics - the reporting component and the tracking component.

The reporting component is what you see when you log in and view charts and tables about your users, visits, and Ecommerce transactions.

The tracking component is the JavaScript code that runs on your website and sends data to Google Analytics. Google processes this data, stores it in databases, and uses it to generate the reports you see when you log in.

When you upgrade to Universal Analytics, the two components are handled differently. The reporting component is upgraded independently of the tracking component. For the most part, the upgrade of the reporting component is an automated process that requires little intervention on your part.

On the other hand, the tracking code must be updated manually. Google calls this process retagging (see Upgrading to Universal Analytics). Your Ecommerce site contains lots of tracking code that developers wrote and placed on your site to keep track of the products purchased, amount spent, taxes collected, etc. Along with the upgrade to Universal Analytics, you now have the option to retag this tracking code to take advantage of all the new features that are available.

Choices, choices

The reason that you are faced with three choices for Ecommerce can be summed up in terms of Google Analytics' past, present, and future.

Past – Google is providing backward compatibility with classic Google Analytics tracking code. Because retagging can be a time-consuming process, Google has provided an upgrade path that enables you to upgrade only the reporting component, and continue to run your tracking code as-is.

Present – Google also provides a straight-forward upgrade path for Ecommerce tracking code that is relatively easy to implement. This enables you to take advantage of the many new Universal Analytics tracking features (e.g., cross-platform user tracking) without having to undertake a major overhaul of your Ecommerce tracking. This approach brings you in synch with Google's new standard for tracking code.

Future – Looking to the future, Google has released Enhanced Ecommerce tracking for Universal Analytics. This upgrade provides powerful new features for tracking more than just transactions. For example, you can now do extensive tracking of pre-purchase behavior, like product and promotions views, to better determine how effectively your site design and marketing are driving transactions.

The choice that makes sense for you depends on the specific needs of your business, and how effectively your existing Ecommerce tracking is supporting your decision-making process.

While you have choices in which approach to take for Ecommerce, you don't really have much of a choice when it comes to upgrading your account to Universal Analytics. Google is now in Phase 3 of the upgrade, and has started auto-upgrading accounts. This means, even if you do nothing, Google will eventually upgrade your account.

Below, we look at each of the options for retagging:

  • Classic Google Analytics tagging.
  • Universal Analytics tagging.
  • Enhanced Ecommerce tagging.

Classic Google Analytics Tagging

There's an old saying among mechanics, engineers, and handymen: if it ain't broke, don't fix it. This is the easiest way to go in the short term. If you are happy with how your Ecommerce tracking is working today, you can do nothing. Your tracking code will continue to work for the foreseeable future.

Google has not provided a drop-dead date for upgrading tracking code. The current tracking code library – ga.js – has not yet even been deprecated. Deprecation is scheduled for Phase 4 of Google's upgrade process. We are currently in Phase 3. Even after deprecation in Phase 4, the older ga.js library may continue to be supported for some time. Google states that data from deprecated features will continue to be processed for a minimum of 2 years.

One problem with this approach, however, is that it will prevent you from upgrading any of your tracking code to the new Universal Analytics tracking code library – analytics.js. As a result, you will not be able to take advantage of many of the improvements in tracking that Google has introduced (See our blog post from last week: Upgrading to Universal Analytics).

While in theory, you could run part of your site using analytics.js tracking code, and keep your Ecommerce tracking code with ga.js, Google does not recommend this. In Google's Reference - Complete Web Upgrade: ga.js / dc.js to analytics.js, they caution:

When upgrading to analytics.js, you must remove the basic ga.js snippets from your pages to avoid overcounting pageviews in your reports.

So, while doing nothing may be the right approach in the short term, you should start planning for an upgrade of your tracking code.

Universal Analytics Tagging

From an Ecommerce perspective, the biggest advantage of upgrading to Universal Analytics tagging is the ability to track the purchasing behavior of users across multiple sessions and devices. As described in last week's post (Stop tracking visits. Start tracking users.), you can isolate and analyze your "super users" – such as return buyers or above average spenders.

To understand the power of Universal Analytics tagging, consider this example. Suppose Jack visits your site using the Safari browser one day and buys something. The next day, he buys something else while browsing from Chrome. Then, the following week, he makes a purchase from his smartphone. With Classic Analytics tagging, these transactions show up as unrelated. In Universal Analytics, you can tie them all together and realize that they are all from Jack. Since Jack is such a good customer, you probably want to attract more people like Jack to your site. With Universal Analytics tagging, you can define groups of users like Jack as cohorts, and learn how they find your site, what features they like, and what they are interested in. You can even create Remarketing lists and create display advertising specifically targeting users like Jack.

Tracking user behavior like this, across browsers and devices, relies on Google's User-ID feature which is new to Universal Analytics. To implement this feature, and take advantage of the Ecommerce benefits, you need to retag your site to use the Universal Analytics tracking library.

Luckily, the Ecommerce retagging is relatively straightforward. Below is an example of posting a transaction using classic tracking code and using Universal Analytics tracking code.


'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


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

For more detailed examples of the retagging process, see the Ecommerce section of Google's Reference - Complete Web Upgrade: ga.js / dc.js to analytics.js.

Enhanced Ecommerce Tagging

On May 28, 2014, Google announced the beta release of Enhanced Ecommerce. This is a major upgrade of Ecommerce tracking designed to provide better insight into buying behavior and what drives purchases.

As a result, we now have a third choice for Ecommerce tagging. For those who have struggled with the limitations of Google Analytics Ecommerce, this is a very welcome choice.

Using the two options discussed above, we are limited to tracking products and transactions. There are no Ecommerce capabilities for tracking the pre-purchase behavior that leads up to the purchase of a particular product. However, using Enhanced Ecommerce, we can now track:

Product detail views – track how frequently users click on products to learn more about them. This lets us know which products are getting the most attention and focus in on pricing and promotion to generate more sales.

Add-to-cart actions – track the items that are added to carts, even if they are not purchased. This enables us to which products are "almost purchased" and work on strategies to reduce abandonment.

Promotions – track internal promotions (e.g., coupons) and external merchandising efforts (e.g., affiliate sites). This helps us understand the effectiveness of our marketing at generating revenue.

Refunds – track refunds online and offline (Offline is handled by uploading data gathered at the point of return). Using this feature, we can get a better idea of the true revenue (sales minus returns) for a product or promotion.

In addition to these important enhancements to tagging, there are other benefits that help you manage and understand a complex Ecommerce site.

Importing product data – We can now upload product meta-data to Universal Analytics. If you have hundreds or thousands of products, this is a huge productivity improvement feature. With classic or Universal Analytics tagging, product data like name, price, category, needs to be coded into the actual JavaScript running on our sites. Developers have had to write their own data management systems to keep all this data in-synch with the site tagging. Now, Google is providing this mechanism for us. For more details, see: Import Product Data.

Checkout funnel – We can now define funnels specific to our individual checkout processes. Traditional funnels can only be defined in terms of page views (URLs), but the new checkout funnels allow specific events, representing completed steps in the checkout process, to be part of the funnel.

Setting up a checkout funnel is easy. We can do it right from the Admin panel of our Ecommerce view, as shown below.

creating an ecommerce funnel in Google Analytics

The ability to use events as steps in these funnels is a really significant improvement. For example, you can now much more easily track steps like the redirect to a payment processor (e.g., PayPal).

Below is an example of the type of report we can get from these checkout funnels.

enhanced ecommerce funnel report

For more details on the new types of reports available with Enhanced Ecommerce, see: Enhanced Ecommerce reports.

How much work is it to set up Enhanced Ecommerce?

Progress comes with a price, and Enhanced Ecommerce is no exception. You are going to need to invest some time in both planning for and implementing this upgrade.

For starters, you cannot mix and match Enhanced Ecommerce code with the standard Universal Analytics Ecommerce tagging. Google provides this warning in their Overview of Ecommerce Tracking.

Important: The Ecommerce plug-in should not be used alongside the Enhanced Ecommerce (ec.js) plug-in.

Given this limitation, we suggest you start with a design phase, rather than jumping right in to retagging your site. Enhanced Ecommerce provides many more data fields than standard Universal Analytics for tracking user buying behavior. Taken together, these fields are referred to as the data model for Enhanced Ecommerce. A good place to start the design processes is by mapping your existing promotions and products to the Enhanced Analytics data model.

Since you are already running Ecommerce, you have already defined how you want to track transactions and items data. These are part of the standard Ecommerce data model. However, you may want to review, or even document for the first time, how this works on your site today.

Next, you will want to design how to track the new components in the Enhanced Ecommerce data model: product impressions and promotions, cart adds and removes, refunds, etc. To get started, review Google's model and document how actions and data on your site will be stored in the fields that are provided by Enhanced Analytics. This up-front work will make the coding much faster and reduce bugs and inaccurate data during roll-out.


Ecommerce is becoming steadily more sophisticated. Google Analytics has made great strides to help our insights keep up with this increasing sophistication. With Universal Analytics, we get better insight into users and how to market to our most valuable customers. With Enhanced Analytics, we can go even further and mine deep insights about how effectively our promotions are driving purchases and net revenue. With this increased sophistication comes increased complexity. Fortunately, Google is also taking steps to help manage Ecommerce site complexity – like providing the ability to import product data.

We recommend that you take a good look at both the capabilities in Universal Analytics and Enhanced Ecommerce. Whether you decide to stick with classic Ecommerce tracking, move to Universal Analytics tracking, or go all the way to Enhanced Ecommerce will depend on the complexity of your site and the business benefits you can derive from improved insight.

Content Offer

An introductory guide to inbound marketing

Get to grips with marketing in the digital age

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat.

Download Guide

We promise that we won't SPAM you.