Ecommerce with Google Tag Manager

Ecommerce with Google Tag ManagerLet’s remember that Ecommerce reports in Google Analytics allow you to analyze the purchase activity on your site or app, where you can see transaction details (such as Transaction ID, Affiliation, Revenue, Shipping and tax) and product details (such as Product Name, SKU, Product Category, Unit Price and Quantity). Basically, this feature tracks the sale data on the “thank you” or “confirmation” page of your online store.

Besides Ecommerce tracking, there is another Ecommerce implementation method called Enhance Ecommerce which is an improved version of the traditional Ecommerce tracking snippet that allows you to track shopper behavior and conversions. In this post,we are just going to cover how to setup the Standard Google Analytics Ecommerce tracking using Google Tag manager (GTM). If you want to know how to track Enhanced ecommerce with GTM click here.

So, to implement Standard Ecommerce tracking with GTM, follow the steps bellow:

  1. First of all, check if your shopping cart software let you add GTM to your website and provides built-in data layer support for transaction data. If it does, then in just a few clicks you can install Ecommerce tracking via GTM and all will be done.However, if your shopping cart software doesn’t provide e-commerce tracking support via GTM then keep reading.
  1. Enter GTM and add a Google Analytics tag of type Universal Analytics.
  2. Enter your Tracking ID and choose track type of Transaction.


        4. Specify when the tag should be triggered. Click on “More” and then you can choose a trigger created previously or create a new one.ecommerce-with-gtm-3ecommerce-with-gtm-4

The trigger you need to create to fire this tag it’s configured as shown in the image bellow:ecommerce-with-gtm-5

      5. Once you choose the trigger, click in “Create Tag”.

All the transaction information should be passed via the data layer (which is simply a JavaScript array used to store information and send it to GTM container). This data needs to be filled dynamically, so you will need the help of a developer to create the data layer for you.

According to Google Analytics help page, the required and optional variables are shown below:ecommerce-with-gtm-6Take a look on the developer documentation to see a complete list of data types that are supported.

Here's an example of how the data layer code might be implemented in JavaScript:


  6. Then, place this code above the Google Tag Manager container snippet so that the data layer is ready when Google Tag Manager fires the Google Analytics tag.

And that’s it!

Don’t forget to preview and debug this tag to make sure that everything works properly. Or you can use the Google Tag Assistant plug-in from the Chrome Web Store as well, to help you verify that you have installed your Google tags correctly on your page.

Let me know if you have any questions or suggestions! I’ll be pleased to read and answer them.

Want to learn more on Google Analytics?  Subscribe below.

If you like my articles,