Add GA ecommerce tags in GTM


@jamaicawinshipgmail-com @andreea-macoveiciuc-content-expert @danielisler1gmail-com

Business Benefits

Increase tag management efficiency.

In Google Analytics, navigate to Admin > Ecommerce Settings and toggle Enable E-commerce on.

Click on Tags > New Button > Tag Configuration to create a Universal Analytics tag and set Track Type to Transaction.

Enter your Tracking ID and tracking or campaign parameters like category, action, label, and value.

Add data layer variables to your page to allow GTM to read and use information from your site.

Add this code to the <head> section of your web page, above your container snippet.

Populate your data layer with transaction information to make GA ecommerce tracking with GTM work.

All transaction and product data should pass through the data layer with these variables:

  • Required Transaction Data: TransactionID and TransactionTotal
  • Required Product Data: Name, SKU, Price, and Quantity.

Put the ecommerce dataLayer.push code above the GTM script so that the data layer is ready when GTM fires the GA tag.


  • Add the code at the bottom of the GTM container on a Thank you page.
  • Activate the code on a page that’s not reloaded after a successful purchase.

A dataLayer.push() with minimum required ecommerce object for purchase looks like this:

Click on Trigger > New > Trigger Configuration > Click - Just Links to create a trigger.

  • Enable Wait for Tags.
  • Disable Check Validation.
  • Select Some Clicks from This trigger fires on*.*

Click on Click URL > Ends With > input the data layer code and then save so that the tag fires on the page with your data layer.

Test the tag with GTM to see if it fires on the right place and time as the data layer.

  1. Enable Debug and Preview Mode**.
  2. Open the page you’re tracking.
  3. Complete a purchase.

Open your GA console and navigate to Conversions to view enhanced ecommerce reports.

Check product performance, shopping behavior, and checkout behavior. This gives you insights into all ecommerce events happening on your site.

Last edited by @hesh_fekry 2023-11-14T15:45:40Z