Skip to content

Google Tag Manager is a user-friendly, yet powerful and cost-effective solution that is a must-have integration for every Magento store. It simplifies the process of adding and managing third-party JavaScript tags. With dozens of custom events and hundreds of data points our extensions the #1 GTM solution for Magento.

Notifications You must be signed in to change notification settings

magepal/magento2-google-tag-manager

Repository files navigation

MagePal Adobe Commerce Extensions

Google Tag Manager for Magento 2 / Adobe Commerce with Advance Data Layer

Total Downloads Latest Stable Version

Whether you are a small Magento retailer or an Adobe Commerce Enterprise customer, our suite of Google Tag Manager extensions will help you integrate the most challenging GTM projects within days, instead of spending weeks or months creating custom solutions.

For Magento 2.0.x, 2.1.x, 2.2.x, 2.3.x and 2.4.x

Magento Enhanced Ecommerce for Google Tag Manager

What is Google Tag Manager

Google Tag Manager (GTM) is a user-friendly, powerful and essential integration for every Magento store. It simplifies the process of adding, editing and managing third-party JavaScript tags and other snippets of code on your Magento site. With GTM, you can quickly and easily add Facebook tags, AdWords Conversion Tracking, Re-marketing, Bing UET, SnapChat, DoubleClick code, Google Analytics, and many more in a breeze without the need for a developer to make changes to your Magento code providing the data is available to Google Tag Manager.

Google Tag Manager makes running your digital marketing campaigns much easier when calibrating with multiple department and Ad agencies by making available the right set of tools so that everyone can get their job done quickly without relying on developers.

Without having the all data you need at your fingertips your integration will become a difficult, time-consuming and messy since each developer will only focus on the current task at hand instead of focusing on writing reusable components for future integration.

Our extension provides a vast array of over 60 preconfigure data layer elements to make integrating your Magento store with any other third-party service a breeze using Google Tag Manager. Extracting, customizing and adding your own custom data from your Magento store to Google Tag Manager is as easy as 10 lines of code using our easy to customize APIs.

⚠️ Google Tag Manager 2.7.0 has some breaking changes to Enhanced Ecommerce. Please download the latest version of Enhanced Ecommerce 1.7.0 or greater from www.magepal.com account.

Why use our Google Tag Manager extension?

Adding Google Tag Manager code snippet to the header section of your Magento / Adobe Commerce store may seem like the ideal, and most efficient way to add GTM to your site. But this will not be sufficient and limit your ability to take full advantage of GTM when integrating third-parties tracking codes that require data from your Magento stores, such as product name, price, items added to cart, order items, total, shipping amount or any other data. Our extension provides hundreds of data elements and events to accomplish any integration and provides the building block to make your next integration a success. With a few lines of code, you can quickly extend our extension to accomplish your most challenging integration. Google Tag Manager is only as powerful as the data layer powering it. Learn more about customizing Google Tag Manger.

Google Analytics 4

Upgrade to the next generation of tracking from Google. Google Analytics 4 comes with a bunch of key features that make it very different and more powerful than Enhanced Ecommerce. Gain access to GA4 new approach to privacy-first tracking, channel measurement, and AI based predictive data with MagePal Google Analytics 4 Extension.

Google Analytics Enhanced E-commerce

Want to track more? Upgrade to our new Enhanced E-commerce for Google Tag Manager to take full advantage of Google Analytics most powerful e-commerce features. Gain valuable insight and increase your conversion rate by leveraging Google Enhanced Ecommerce to better understand your user actions and behaviors.

Learn more about our Google Enhanced Ecommerce extension today. A small increase in your store’s conversion rate can make a giant impact on your revenue.

Third Party Integration with Google Tag Manager

Adding Facebook pixel, Bing UAT, SnapChat or any other third-party code snippet to your website but frustrated by all the hassle and time it takes to configure Google Tag Manager? Learn how simple and easy it is to integrate any tracking code to your Magento store with our new DataLayer extension.

General Data Protection Regulation (GDPR) Support

Now you can quickly disable analytic tracking for customers' who do not want to by track by enabling Cookie Restriction Mode or base on existing or non-existing cookie.

  • Stores > Configuration > General > Web > Default Cookie Settings > Cookie Restriction Mode.

Please Note: Merchants should consult with their own legal counsel to ensure that they are compliant with the GDPR.

Get more from Google Tag Manager with our add-on Extensions

Features GTM EE GA4 DL
Global Page Tracking X X X
Order Conversion Tracking X X X
Page Type Event X X
Product Clicks X X
Product Detail Impressions X X
Add to Cart X X
Remove from Cart X X
Checkout Steps X X
Order Refunds X X
Admin Order Tracking X X
Access DataLayer using JS X
Bing UET Tracking X
Full Facebook Tracking X
Custom Image Pixel Tracking X
Custom iFrame Tracking X
Third-Party Integration X
Extend individual page type X

GTM - Google Tag Manager for Magento 2 Extension

GA4 - Google Analytics 4 for Google Tag Manager Extension

EE - Enhanced E-commerce for Google Tag Manager Extension

DL - DataLayer for Google Tag Manager Extension

Features

  • Quick and easy setup
  • Add tag via XML layout and/or observer
  • Advance Data layer with over 60+ data elements
  • Fully customizable with 10 lines of code
  • General Data Protection Regulation (GDPR) Support
  • GTM Multiple Environments Support
  • Content Security Policies Support

Benefits of using Google Tag Manager with Magento

There are a number of benefits to using GTM with Magento:

  • One Centralized Tag Management source - Google tag Manager is one of the tops, and most widely used JavaScript tag management, therefore, anyone with Google Tag Manager experience will have all the knowledge they need to make edits to your site.
  • Little to No Technically Knowledge - Digital marketer agencies with so tech skills can quickly make and publish changes to Google Tag Manager without needing to call in developers.
  • Version Control - Every change to your Google Tag Manager container is track with a history of who and what was changed.
  • Easy to Use - Google Tag Manager is very simple and easy to use. You can easily export your GTM configuration in a text file that could be saved and reimport.
  • Reduce Number of Magento Extensions Needed - Installing individual extensions for AdWords, Facebook tracking, Snapchat, Microsoft Bing is time-consuming and resource intensive on your Magento store. Using Tag Manager you only need to install and maintaining one extension.
  • Eliminate Themes and Order Success Page Edits - 99% of merchants, developers and agencies don't know or use best practice when inserting javascript tracking code snippets to a Magento store, and often just add hardcode each javascript code snippets at random places within the themes files which make it unmaintainable over time as you switch between different service provider.

How to Customize Google Tag Manager Extension

Need to add more data to your data layer or change existing data to meet your client needs? Add, changing or removing information from the data layer to meet your client needs is as simple as adding few lines of php and di.xml code. See our documentation to learn more about how to customizing Google Tag Manger.

Documentation & Installation Guide

How to Installing Google Tag Manager

How to setup Google Tag Manager

How to customizing Google Tag Manager

Google Tag Manger Data Layer attributes

How to debugging Google Tag Manager

Composer Installation

composer require magepal/magento2-googletagmanager

Data layer attributes

Our Magento extension provide a vast array of over 60 preconfigure data layer elements to make integrating your Magento store with any third-party service a breeze using Google Tag Manager.

Triggered Events

Home Page Events
  • Events
    • homePage**, allPage**, cmsIndexIndexPage**, mpCustomerSession
Category Page Events
  • Events
    • productImpression*, categoryPage**, allPage**, catalogCategoryViewPage**, mpCustomerSession
    • productClick*, addToCart*, productListSwatchClicked**, productListSwatchSelected**
    • view_item_list***, select_item***, add_to_cart***
Product Detail Page Events
  • Events
    • productDetail*, productImpression*, productPage**, allPage**, catalogProductViewPage**, mpCustomerSession
    • productClick*, addToCart*, removeFromCart*, productDetailSwatchClicked**, productDetailSwatchSelected**, addToCartItemOutOfStock*, addToCartItemOptionRequired*, addToCartItemInvalidQtyIncrements*
    • view_item***, select_item***, add_to_cart***, view_item_list***
Shopping Cart Page Events
  • Events
    • cartPage**, allPage**, checkoutCartIndexPage**, productImpression*, mpCustomerSession
    • productClick*, addToCart*, removeFromCart*
    • select_item***, add_to_cart***, remove_from_cart***, view_item_list***
Checkout Page Events
  • Events
    • checkoutPage**, allPage**, checkoutIndexIndexPage**, checkout*, checkoutOption*, mpCustomerSession
    • checkoutEmailValidation*, shippingMethodAdded*, checkoutShippingStepCompleted*, checkoutShippingStepFailed*, paymentMethodAdded*, checkoutPaymentStepFailed*, checkoutPaymentStepCompleted*
    • begin_checkout***, add_shipping_info***, add_payment_info***
Order Confirmation Page Events
  • Events
    • purchase*, orderSuccessPage**, allPage**, checkoutOnepageSuccessPage**
Other Events
  • Events
    • compareProductAdded**, compareProductRemoved**, wishlistProductAdded**, wishlistProductRemoved**, customerLoginAfter**, customerRegisterAfter**, newsletterSubscriberAdded** newsletterUnsubscribed**

Data Layer Variables

Customer

  • Trigger: event equals mpCustomerSession
    • customer.isLoggedIn
    • customer.id
    • customer.groupId
    • order.email_sha1**
    • order.email**
    • order.customer_id**

Product Impression

  • Trigger: event equals productImpression
    • ecommerce.impressions[].name*
    • ecommerce.impressions[].id*
    • ecommerce.impressions[].price*
    • ecommerce.impressions[].list*
    • ecommerce.impressions[].position*
    • ecommerce.impressions[].category*

Category

  • Trigger: event equals categoryPage
    • category.id
    • category.name
    • category.path

Search Page

  • Trigger: event equals searchPage
    • search_term*

Product Detail Page

  • Trigger: event equals productPage

    • product.id
    • product.name
    • product.sku
    • product.parent_sku
    • product.price
    • product.product_type
    • product.attribute_set_id
    • product.path
    • product.image_url
  • Trigger: event equals productDetail

    • ecommerce.currencyCode*
    • ecommerce.products[].id*
    • ecommerce.products[].name*
    • ecommerce.products[].category*
    • ecommerce.products[].price*

Cart

  • Trigger: event equals cartPage
    • cart.hasItems
    • cart.items[].sku
    • cart.items[].parent_sku
    • cart.items[].product_type
    • cart.items[].name
    • cart.items[].parent_name
    • cart.items[].price
    • cart.items[].price_incl_tax
    • cart.items[].discount_amount
    • cart.items[].tax_amount
    • cart.items[].quantity
    • cart.total
    • cart.itemCount
    • cart.itemQty
    • cart.hasCoupons
    • cart.couponCode
Add to Cart
  • Trigger: event equals addToCart
    • ecommerce.add.products[].id*
    • ecommerce.add.products[].name*
    • ecommerce.add.products[].price*
    • ecommerce.add.products[].quantity*
    • ecommerce.add.products[].parent_sku*
    • ecommerce.add.products[].variant*
    • ecommerce.add.products[].category*
Remove from Cart
  • Trigger: event equals removeFromCart
    • ecommerce.remove.products[].id*
    • ecommerce.remove.products[].name*
    • ecommerce.remove.products[].price*
    • ecommerce.remove.products[].quantity*
    • ecommerce.remove.products[].variant*
    • ecommerce.remove.products[].category*

Global Data Layer

  • Trigger: event equals addToCart

    • cart.add.products[].id*
    • cart.add.products[].name*
    • cart.add.products[].price*
    • cart.add.products[].quantity*
    • cart.add.products[].parent_sku*
    • cart.add.products[].variant*
    • cart.add.products[].category*
  • Trigger: event equals removeFromCart

    • cart.remove.products[].id*
    • cart.remove.products[].name*
    • cart.remove.products[].price*
    • cart.remove.products[].quantity*
    • cart.add.products[].parent_sku*
    • cart.remove.products[].variant*
    • cart.remove.products[].category*

Order

  • Trigger: event equals purchase (Google Analytics)

    • transactionId
    • transactionAffiliation
    • transactionTotal
    • transactionShipping
    • transactionTax
    • transactionCouponCode
    • transactionDiscount
    • transactionSubTotal
    • transactionProducts[].sku
    • transactionProducts[].parent_sku
    • transactionProducts[].product_type
    • transactionProducts[].name
    • transactionProducts[].price
    • transactionProducts[].quantity
  • Additional Order Date (Generic)

    • order.order_id
    • order.store_name
    • order.total
    • order.subtotal
    • order.shipping
    • order.tax
    • order.coupon_code
    • order.coupon_name
    • order.discount
    • order.payment_method.title
    • order.payment_method.code
    • order.shipping_method.title
    • order.shipping_method.code
    • order.is_virtual
    • order.is_guest_checkout
    • order.email_sha1**
    • order.email**
    • order.customer_id**
    • order.has_previous_order**
    • order.is_first_order**
    • order.previous_order_count**
    • order.is_new_customer**
    • order.items[].sku
    • order.items[].id
    • order.items[].parent_sku
    • order.items[].product_id
    • order.items[].name
    • order.items[].parent_name
    • order.items[].price
    • order.items[].price_incl_tax
    • order.items[].quantity
    • order.items[].subtotal
    • order.items[].product_type
    • order.items[].discount_amount
    • order.items[].discount_percent
    • order.items[].tax_amount
    • order.items[].is_virtual
    • order.items[].variant
    • order.items[].categories

* - Data layer provide by our Enhanced Ecommerce Extension

** - Data layer provide by our Data Layer Extension

*** - Data layer provide by our Google Analytics 4 Extension

Contribution

Want to contribute to this extension? The quickest way is to open a pull request on GitHub.

Support

If you encounter any problems or bugs, please open an issue on GitHub. For fast Premium Support visit our Google Tag Manager product page for detail.

Need help to set up or want to customize our extension to meet your business needs? Please email [email protected] and if we like your idea we will add this feature for free or at a discounted rate.

Magento 2 / Adobe Commerce Extensions

© MagePal LLC. | www.magepal.com