Using the right Magento 2 extension is more essential now than ever. With MagePal, you can rest assured that you are getting the best quality Magento extensions, each line of code are carefully crafted and rigorously tested. Spend less time debugging and more time doing what you do best with MagePal extensions!
Google Tag Manager (GTM) is a user-friendly, powerful and must have integration in every Magento store. It simplifies the process of adding, edit and manage 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.
Want to learn more about your customers? Gain valuable insight on your customers shopping behavior, sales performance and more. Upgrade to our new Enhanced E-commerce to take full advantage of Google Analytics most valuable features.
Adding Facebook Pixel, Bing UET, or other third-party JavaScript to your site using Google Tag Manager? Learn how simple and easy it is to integrate any third party service with our new DataLayer extension.
Need Help? Purchase Support
composer require magepal/magento2-googletagmanager
Using Hyvä Magento 2 Theme?
composer require hyva-themes/magento2-magepal-googletagmanager
php -f bin/magento module:enable --clear-static-content MagePal_GoogleTagManager
php -f bin/magento setup:upgrade
Log into your Magento 2 Admin
Like our extensions? Would you be kind enough to leave us a Google review? It only takes a minute and we’d be eternally grateful! Just click the link to go to our MagePal Google Business page and leave us your feedback.
Like all other open source projects, sometimes things work and sometimes they don't for one reason or another.
We receive multiple emails & support tickets almost daily asking for help and we would love to help but in most cases, these issues have nothing to do with our extension and mostly caused by lack of basic Magento knowledge.
At MagePal our main focus is designing great Magento Extension and due to our limited resources, we simply can not provide free support for a free product.
Our affordable technical support include help with installation, usage, configuration, and troubleshooting for our Free Community Edition 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
Add more information to the data layer to meet your client needs is as simple as adding few lines of php and di.xml code in your custom extension.
namespace MagePal\GoogleTagManagerAddons\DataLayer\CategoryData;
/**
* Class ItemBrandProvider
* @package MagePal\GoogleTagManager\DataLayer
* @method getCategory()
*/
class CategoryIdProvider extends \MagePal\GoogleTagManager\DataLayer\CategoryData\CategoryAbstract
{
/**
* @return array
*/
public function getData()
{
$data = [
'category_id' => $this->getCategory()->getId()
];
return $data;
}
}
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagePal\GoogleTagManager\DataLayer\CategoryData\CategoryProvider">
<arguments>
<argument name="categoryProviders" xsi:type="array">
<item name="category-id" xsi:type="object">MagePal\GoogleTagManagerAddons\DataLayer\CategoryData\CategoryIdProvider</item>
</argument>
</arguments>
</type>
</config>
namespace MagePal\GoogleTagManagerAddons\DataLayer\ProductData;
/**
* Class OrderProvider
* @package MagePal\GoogleTagManager\DataLayer
* @method getProduct()
*/
class ProductProvider extends \MagePal\GoogleTagManager\DataLayer\ProductData\ProductAbstract
{
/**
* @return array
*/
public function getData()
{
$data = [
'brand' => $this->getProduct()->getManufacturer()
];
return $data;
}
}
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagePal\GoogleTagManager\DataLayer\ProductData\ProductProvider">
<arguments>
<argument name="productProviders" xsi:type="array">
<item name="product-id" xsi:type="object">MagePal\GoogleTagManagerAddons\DataLayer\ProductData\ProductProvider</item>
</argument>
</arguments>
</type>
</config>
namespace MagePal\GoogleTagManagerAddons\DataLayer\QuoteItemData;
/**
* Class OrderItemProvider
* @package MagePal\GoogleTagManager\DataLayer
* @method getQuote()
* @method getTransactionData()
*/
class QuoteItemProvider extends \MagePal\GoogleTagManager\DataLayer\QuoteData\QuoteItemAbstract
{
/**
* @return array
*/
public function getData()
{
$data = [
'brand' => $this->getItem()->getProduct()->getManufacturer()
];
return $data;
}
}
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagePal\GoogleTagManager\DataLayer\OrderData\OrderItemProvider">
<arguments>
<argument name="orderItemProviders" xsi:type="array">
<item name="item-brand" xsi:type="object">MagePal\GoogleTagManagerAddons\DataLayer\QuoteData\QuoteItemProvider</item>
</argument>
</arguments>
</type>
</config>
namespace MagePal\GoogleTagManagerAddons\DataLayer\QuoteData;
/**
* Class QuoteProvider
* @package MagePal\GoogleTagManager\DataLayer
* @method getQuote()
* @method getTransactionData()
*/
class QuoteProvider extends \MagePal\GoogleTagManager\DataLayer\QuoteData\QuoteAbstract
{
/**
* @return array
*/
public function getData()
{
$data = [
'tax' => $this->getQuote()->getTax()
];
return $data;
}
}
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagePal\GoogleTagManager\DataLayer\QuoteData\QuoteProvider">
<arguments>
<argument name="quoteProviders" xsi:type="array">
<item name="order-item-provider-brand" xsi:type="object">MagePal\GoogleTagManagerAddons\DataLayer\QuoteData\QuoteProvider</item>
</argument>
</arguments>
</type>
</config>
namespace MagePal\GoogleTagManagerAddons\DataLayer\OrderItemData;
/**
* Class OrderProvider
* @package MagePal\GoogleTagManager\DataLayer
* @method getItem()
*/
class ItemBrandProvider extends \MagePal\GoogleTagManager\DataLayer\OrderData\OrderItemAbstract
{
/**
* @return array
*/
public function getData()
{
$data = [
'brand' => $this->getItem()->getProduct()->getManufacturer()
];
return $data;
}
}
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagePal\GoogleTagManager\DataLayer\OrderData\OrderItemProvider">
<arguments>
<argument name="orderItemProviders" xsi:type="array">
<item name="item-brand" xsi:type="object">MagePal\GoogleTagManagerAddons\DataLayer\OrderData\OrderItemProvider</item>
</argument>
</arguments>
</type>
</config>
namespace MagePal\GoogleTagManagerAddons\DataLayer\OrderData;
/**
* Class OrderProvider
* @package MagePal\GoogleTagManager\DataLayer
* @method getItem()
* @method getOrder()
* @method getListType()
*/
class OrderProvider extends \MagePal\GoogleTagManager\DataLayer\OrderData\OrderAbstract
{
/**
* @return array
*/
public function getData()
{
$data = [
'tax' => $this->getOrder()->getTax()
];
return $data;
}
}
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagePal\GoogleTagManager\DataLayer\OrderData\OrderProvider">
<arguments>
<argument name="orderProviders" xsi:type="array">
<item name="order-provider-tax" xsi:type="object">MagePal\GoogleTagManagerAddons\DataLayer\OrderData\OrderProvider</item>
</argument>
</arguments>
</type>
</config>
$("body").on("mpCustomerSession", function (event, customer, cart, datalayer){
});
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.
*
- Data layer provide by our Enhanced Ecommerce Extension
**
- Data layer provide by our Data Layer Extension
Even the most advanced Google Tag Manager users often run into issues while setting up new tags. Frustrated by the process we often ask ourselves, why doesn’t my tag fire, what data is sending to Google Analytics and why didn’t this trigger work?
One of the most overlooked, yet important steps while working with GTM is its preview and debugging mode. Google Tag Manager’s preview mode allows you to preview your container code as if the current container draft was deployed so that you can test your configuration before it is published.
To enable Google Tag Manager preview mode, click Preview. Google Tag manager will display a banner across the top of the workspace overview page to indicate that preview mode is active.
Once preview mode is enabled a debug pane will display at the bottom of your browser content, which display all the fired tags fired, which data is available on the data layer at that moment in time and the order the tags are firing.
Whether you are integrating Bing, Facebook, SnapChat, Pinterest, or any other services our extension make it easy.
Quickly previewing alternative product images on your category list page.
Providing your customer with a beautiful and functional order package tracking without leaving your site.
Total Downloads
years experience with Magento
Magento / Adobe Commerce Extensions
With millions of downloads worldwide, install with confidence knowing that our extensions will just work.
Is your Magento store ready for the future? Say hello to the new Google Analytics 4, which is built from the ground up with all-new features and advanced machine learning technology.