Nothing beats Google Tag Manager when it comes to eCommerce tracking (GTM). It’s a robust tool that lets you add and update tracking tags without having to change the code of your website.

GTM helps you understand the elements that drive sales and the sources that attract the most visitors by tracking significant interactions on your eCommerce site.

With Google Tag Manager (GTM), you can create new tags with just a few clicks. Google Tag Manager, the world’s most popular enterprise-grade tag management tool, works with both Google and third-party tags.

Google Tag Manager allows you to see into your customers’ lives. You can increase conversion and revenue for your business by utilizing Tag Manager to publish and manage tags for your eCommerce store.

We’ve written several articles about the benefits of Google Tag Manager and how to use it, but we haven’t gone into detail about why you should use it for eCommerce. This article explains that. We will highlight the steps to use Google Tag Manager for eCommerce tracking.


What is Google Tag Manager, and how does it work?

Google Tag Manager (GTM) is a free product that caters to the analytics needs of digital marketers. It allows you to handle tags (often JavaScript tracking snippets) from a single interface. GTM, of course, works nicely with other Google products, like Google Analytics Enhanced Ecommerce, which we’ll talk about later in this piece. It also accepts custom tags and tags from third-party vendors.


The Advantages of Using Google Tag Manager for Ecommerce Tracking

1. Get more PPC data

The more data you have as a pay-per-click (PPC) marketer, the better you can optimize your marketing efforts. You won’t be able to determine the core reason for cart abandonment or where people exit your sales funnel if you solely utilize basic tracking configurations.

For example, if you notice that more than half of your prospects are quitting your funnel simultaneously, you may look into that phase and figure out what’s causing the issue.

Perhaps your checkout procedure has too many steps for the customer to complete, or your site navigation is too convoluted and not user-friendly.

If you don’t have information on your sales funnel, you can’t track the customer journey and discover obstacles that keep them from purchasing.

When you use Google Tag Manager to start eCommerce tracking, it gives you all the information you need to figure out which products are performing better than others. This information can be used to evaluate everything from the pricing to the product description to the checkout procedure.


2. Enable Enhanced Ecommerce

Google Tag Manager allows you more control over Google Analytics and other marketing platforms such as Google Ads and Facebook. With the help of GTM, you can construct Google Analytics Enhanced eCommerce events that can help you track the user journey on your website.

You can track various events, including impressions, product views, add or remove from cart, checkout steps, purchase, form submission, error message tracking, etc.

GTM also makes it easier to turn on the Enhanced Conversion option in Google Ads, and it has a lot of features that you’ll discover after you start using it.


3. Track all your tags in one place

Google Tag Manager brings all of your tracking tags together. Your retargeting initiatives, on-site behavior & events, and PPC/display/social marketing are all grouped together in a Google Tag Manager container. GTM also allows you to create selective triggers and add speed optimization steps that ensure triggering all of these tags does not disrupt the user experience on your site.

It also provides an easy-to-use interface for non-technical, marketing-oriented people to add, remove, and edit tracking tags. It separates tracking metrics from the website’s code, allowing marketers to focus on their work without dealing with developers.


4. Reliable eCommerce data

GTM also makes your eCommerce data that is both reliable and accurate. When your tags aren’t operating correctly, they can slow down your site’s load time, cause it to go down, or cause it to lose functionality.

That’s why having a tag management solution in place that lets you immediately check the status of your tags is vital.

With Google Tag Manager’s simple error checking and fast tag loading, you can ensure that every tag is working. You can relax knowing that your mission-critical data is being captured accurately and dependably!

Even during busy holidays or the launch of a new campaign, your IT team will be confident that the site is functioning smoothly, ensuring that everyone is delighted.

Large brands like PizzaHut,, AgeUK, and others have integrated GTM to debut their tags: dependable and accurate eCommerce data.


5. Use Google and third-party tags quickly.

Google Tag Manager works with all tags and includes templates for various Google and third-party tags for web and mobile apps.

Don’t see a tag you’re looking for? You can include it as a custom tag right now. With so much versatility, you can get started on your campaign with only a few clicks.

You can use Google Tag Manager to utilize Google Ads (Adwords), Adroll, Facebook, Hotjar, Criteo, or your own script.


6. Collaborate throughout the organization and update tags quickly.

Within Google Tag Manager, workspaces and flexible access controls enable your team to collaborate effectively. Multiple users can modify tags simultaneously and publish changes as soon as they’re ready. Multi-environment testing allows you to publish to multiple environments to check everything is operating correctly.


How To Setup Google Tag Manager for E-Commerce Tracking

It’s critical to track conversions from your website’s store or payment gateway to keep track of sales and figure out where they’re coming from. E-commerce tracking must be enabled and configured in Google Analytics for you to be able to import this data.

There are a few stages to implementing E-commerce tracking with Google Tag Manager:

1. Activate Google Analytics

  • Navigate to the Admin area of Google Analytics.
  • Go to the View Section.
  • Click E-commerce Settings.
  • Change the setting for Enable E-commerce to ON.

Ecommerce tracking can be enabled by using the Admin section in Google Analytics

2. Implement E-commerce Data Layer.

Your website and payment store structure will significantly impact how you implement the e-commerce data layer. Depending on whether you’re using Magneto and Spotify, you’ll have to pay for a plug-in that embeds the data layer in the code. The code may need to be tweaked depending on the variables you wish to include in Google Analytics. It’s usually advisable to have a developer set this up for you if you’re not comfortable with Javascript or setting up a data layer. An example of an e-commerce data layer is shown below.


window.dataLayer = window.dataLayer || []


'transactionId': '1234',

'transactionAffiliation': 'Acme Clothing',

'transactionTotal': 38.26,

'transactionTax': 1.29,

'transactionShipping': 5,

'transactionProducts': [{

'sku': 'DD44',

'name': 'T-Shirt',

'category': 'Apparel',

'price': 11.99,

'quantity': 1


'sku': 'AA1243544',

'name': 'Socks',

'category': 'Apparel',

'price': 9.99,

'quantity': 2




3. Set the E-commerce Tag in GTM

1. Open Google Tag Manager

2. Click “Trigger”

3. Then create a new Trigger

4. Click Page URL equals to /thank you.

5. Choose a page URL that begins with / thankyou (then enter the precise URL for the thank you page).

6. Name the trigger.

7. Click on a Tag and then New.

8. Select Google Analytics Tag in the Tag Configuration Window.

9. Add your Google Analytics ID to the Tag and select Transaction as the Track Type.

10. Finally, choose a new trigger.

The Trigger Configuration should look like this.

The trigger should be set for just the thankyou page for ecommerce


How to Add Triggers to View Details, Checkout, and Purchase

A trigger in Google Tag Manager listens to your web page or mobile app for specific types of events, such as form submissions, button clicks, or page views, and notifies the tag to fire once the event you specified is detected. All tag must have at least one trigger to be activated.

You need to build three distinct triggers in the Triggers section for the various custom events for eCommerce, including the detail, checkout, and purchase events, which are used to fire the tag to the dataLayer.

To build the rest of the triggers, simply change the term “detail” with “checkout” or “buy,” depending on the trigger you’re working on at the time.


1. Go to Google Tag Manager and either select an existing account or create a new one.

2. If you choose to create a new account, fill in all of the essential information and choose Web as your platform.

3. Select the Triggers tab.

4. To create a new trigger, click the New button in the upper right corner.

5. Select Untitled Trigger and type “detail” in the box.

6. Select Custom Event as the trigger type.

7. The event name must be the same as the trigger name, in this example, “detail.”

8. Untick the Use regex matching box, and the trigger should fire on All Custom Events.

9. Follow the same steps for checkout and purchase trigger.

10. The triggers tab should look like this when you’ve created all three triggers:


  • Adding the Variables

GTM Variables are named placeholders for data that are populated anytime a code is run on a site or mobile app, such as Page URL, which yields the current web page URL.

Follow the steps below to create a variable:

1. Select the Variables tab.

2. Then, in the User-Defined Variables section, click the New button to create a new variable.

3. The Universal Analytics ID is the first variable, which will be added every time we need to write the UA-ID. The variable should be named “Universal Analytic.” Click on the Untitled Variable button to do this

4. Then click on variable Configuration and click the Constant option in the utilities section.

5. Enter the UA-ID from the Google Analytics account in the Value field.

6. Click the Save button.

7. Create a variable with the name “Google Analytics Settings” that will hold the tag settings for each tag. Under the Utilities section, pick Google Analytics Settings as the Variable Type.

8. Add Universal Analytics to the Tracking ID field.

9. Make sure the cookie domain is set to auto.

10. Open the Ecommerce option in More Settings and enable the Enhanced Ecommerce Features and the data layer.

11. In the Page Variables section, create a variable called “GA – e-commerce” and set it up as a Data Layer Variable. This allows you to create a variable in the data layer which will get the e-commerce revenue value.

12. The name of the Data Layer Variable should be eCommerce.

13. The Data Layer Version should be Version 2.

14. Select Save.

15. In the Page Variables section, create a variable with the name “DLV – eCommerce – revenue.” Then set it up as a Data Layer Variable. This adds the revenue variable to the data layer.

16. The Data Layer Variable Name should be eCommerce.purchase.actionField.revenue

17. The Data Layer Version should be Version 2.

18. Remember to save the variable.

19. The variables should resemble the screenshot below.


  • Creating Tags and linking them with Triggers

We’ll need four tags: three for various custom events (detail, checkout, and purchase) and one for page views.

• When users view the live page of an experience, the detail tag will be triggered.

• When users arrive at the checkout page, the checkout tag will activate.

• After finishing the checkout process and before viewing the booking confirmation screen, the purchase tag fires.

Here’s how to create a new tag:

1. Go to the Tags tab of the menu bar.

2. Select New.

3. Click Untitled tag and Type “detail tag.”

4. Click on Tag Configuration.

5. Select Google Analytics: Universal Analytics from the Tag type menu.

6. Select Event from the Track Type

7. Type “e-commerce” in the Category field.

8. Type “detail” in the Action field.

9. The Label field’s recommended setting is {{Page URL}}” which you may type or pick using the Variables button to the right of the field.

10. Set the Non-Interaction Hit to be True.

11. Select the {{Google Analytics}} variable in the Google Analytics Settings.

12. Click the Triggering box down below.

13. Select the detail trigger from the trigger menu.

14. In the upper right corner, click Save.

15. To make the checkout tag, follow the same procedures as before, except:

a. “Checkout tag” should be the name in step 3.

b. “Checkout” should be the Action in step 8, and

c. The checkout trigger must be selected in step 13 of the process.

16. Follow all of the above procedures to make the purchase tag and:

a. Type “DLV – e-commerce -revenue” or select it from the variables list in the Value field.

b. Enable overriding settings in the tag by checking the box.

c. Expand the More Settings menu.

d. Expand the Fields to Set menu.

e. Click the + Add Field button.

f. Type “transport” in the Field Name field and “beacon” in the Value field.

g. Select the purchase trigger in step 13

17. For the all pages tag, use:

a. In step 3, the tag’s name should be “all pages tag.”

b. Page View should be the track type in step 6.

c. the trigger in step should be All pages

18. Finally, the tag tab should resemble this: