Quick Start

Our Google Tag Manager for Magento 2 is a simple, yet powerful extension that allows you to track the shopping behavior of your customers. Gathered data is supplied through the Google Tag Manager service to Google Enhanced Ecommerce analytics to get hints on how to increase marketing ROI and boost sales.

Use this extension to track the shopping behavior of customers. Know when they add/remove/view cart, add to wishlist, begin checkout, make purchase, choose shipping and payment methods, and many other actions.

Configuration Settings

The module Google Tag Manager for Magento 2 requires a prior configuration before it is fully ready to use.

Navigate to Store > Settings > Configuration > Mirasvit Extensions > Google Tag Manager to open the module's settings.

Setup Google Tag Manager

In order to connect your Magento 2 store to the Google Tag Manager service using our extension, it is required that you create an account on the Google Tag Manager (GTM) service. GTM service is used for data collection, and to analyze it with Enhanced Ecommerce reports, a Google Analytics account is required.

To connect your store with the GTM service, activate the Google Tag Manager extension and copy-paste GTM JavaScript snippets into the script and noscript fields.


Replace GTM-XXXX with your GTM account ID.

Setup Google Universal Analytics or Google Analytics 4

The extension automatically passes all page views and e-commerce events to Google Tag Manager and then GTM passes all events to your Google Analytics.

To achieve this, you need to add one Google Universal Analytics configuration tag and one Google Analytics 4 configuration tag to Google Tag Manager:


Attribute mapping

Specify how the GTM extension should map the product attributes.


Option Description
Product Identifier Set the attribute that will be used for product tracking. Select from ID, or SKU.
Brand Select the corresponding brand attribute or leave it empty to disable brand tracking.
Track Variants Set Yes to activate product variants tracking.
Custom dimensions and metrics Create these to collect and analyze the attributes from your store which are not tracked automatically by Google Analytics.
Identifier resolution Select a parent or child product to track.

Customer mapping

Activate Customer Mapping option to track Group ID in your store.


Frontend debug panel

Google Tag Manager provides a debug panel on frontend to monitor the data collection. Activate by adding debug=gtm at the end of the page URL.


The debug panel allows you to see every tracked action made on the page and view which data was collected.