Google Tag Manager 2

Google Tag Manager 2

  • Integrate GTM into Magento
  • Support for e-commerce tags
  • Easy to extend and modify

This Magento 2 extension adds Google Tag Manager to your Magento 2 site, allowing you to manage all your Google tags (Adwords, Analytics) centrally through the Google Tag Manager site.

Cost Free
Current version 0.3.12 (Stable)
Requirements Magento 2.1, 2.2
PHP 5.6 or higher
Download GitHub downloads
Support Support Forum
License OSL (Open Software License)


  • Implement Google Tag Manager in Magento quickly
  • Handle all your script-tags through the Google Tag Manager site
  • Automatic addition to all product-pages
  • Easy styling through Magento backend options
  • Quick and easy setup
  • Easily add extra vars to dataLayer via PHTML-templates per page-type
  • Optional PHP-code allows for further integration (category-pages)
  • Insert via observer or via XML layout


When you want to track conversions in your Magento checkout, our extension helps out as well: It adds the relevant information to all your checkout and cart pages. Do you want to know which variables are on the success page? Use our Checkout Tester extension to preview that page and view its HTML source.

Notice on Magento 2

This extension works only under Magento 2. Do not try to install this extension if you are only using Magento 1.x.


The extension has the following configuration options:

  • Enabled: When this is set to No, the extension does not work.
  • Container Public ID: The ID of your Google Tags container.
  • Insertion Method: A technical thing which is either set to Observer or to XML Layout. If the one does not work for you, try the other one instead.
  • Debug: For developers.

Data layer attributes

This extension adds the following attributes automatically to the data layer. There is no backend option to tune this, so if you want to make changes, change the PHTML templates in your own theme.

  • Generic
    • pageType = Original page route (module/controller/action)
  • Customer
    • customerLoggedIn = Whether the customer has logged in
    • customerId = ID of the customer
    • customerGroupId = Customer group ID
    • customerGroupCode = Customer group code
  • Category
    • categoryId = Category ID
    • categoryName = Category name
    • categoryProducts = Listing of top 3 products
  • Product
    • productId = Product ID
    • productName = Product name
    • productSku = Product SKU
    • productPrice = Product price
  • Order (only the single last order, and only if no quote available)
    • transactionId = Order ID
    • transactionDate = Order date
    • transactionAffiliation = Website name
    • transactionTotal = Order total
    • transactionTax = Order tax
    • transactionShipping = Shipping amount
    • transactionPayment = Payment method
    • transactionCurrency = Currency of website
    • transactionPromoCode = Promotional code used for order
    • transactionProducts  = Listing of all
      • sku = Item SKU
      • name = Item name
      • price = Item price
      • category = Listing of category IDs
      • quantity = Item quantity
  • Quote (current shopping cart)
    • Same as with order, except without shipping and payment

Note that on a product page with an URL that also identifies a category, both the product attributes and the category attributes are added.

More extensions

WebP for Magento

WebP for Magento

Implement WebP into Magento Serve smaller images
New Relic

New Relic

Collect more Magento data within your New Relic dashboard


Save needless delays by skipping Magento 1 logging