Google Tag Manager

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 (GTM) to any analytics suite 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 (GTM) for Magento 2 requires a prior configuration before it is fully ready to use.

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 GTM service. A Google account is required to create a GTM account.

Setup Google Tag Manager

1. Get GTM code snippets

Login to your GTM account and navigate to Workspace section. Click your container ID (find a string GTM-XXXXXX) to open a window with <head> and <body> GTM code snippets.


Copy these GTM JavaScript code snippets.


2. Enable GTM

In your Magento store navigate to Store > Settings > Configuration > Mirasvit Extensions > Google Tag Manager to open the module's settings.

Set Enable GTM to yes.

Paste GTM code snippets:

  • Place <head> code snippet (formatted as <!--Google Tag Manager-->) into the script field
  • Fill no-script field with <body> code snippet (formatted as <!--Google Tag Manager (nocstipt)-->)


Replace GTM-XXXX with the ID of your Google Tag Manager account.

3. Configure the Container

To transfer data from GTM to analytics suite, you need to create GTM tags. You can do this manually in GTM service or use the Container Import section in your Magento store. This provides configuration for GA4, Google Universal Analytics, Google Ads Conversions

To configure a container provide data on:





GTM Tags require some time for activation. Typically it takes 48 hours before GTM tag will start sending data to your Google Analytics account.

Configure Google Ads

Configure Google Ads by providing:


Attribute mapping

This section allows to configure data in the tracking events.


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 Add these to collect and analyze the attributes from your store which are not tracked automatically by our extension.
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.