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.
Activate Enable GTM Logging for extension to write logs and store them in the file var/log/gtm_all.log.
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:
- Google Analytics 4: Measurement ID. In your Google Analytics accoutn navigate to Admin > Property column > Data Streams > Web data stream.
Note
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:
- Google Ads Conversion ID
- GoogleAds Conversion Label
- Dynamic remarketing with Google Analytics. Dynamic remarketing with Google Analytics allows you to create personalized advertising campaigns by showing users ads for products or services they have already viewed on your site.
Admin Operations Tracking
- Tracking Refund. Enable to track the return of goods
- Tracking Admin Order. Enable to track orders created through admin.
-
GA API Secret. Paste here your GA API Secret.
To add a GA API Secret:
- Go to analytics.google.com. click Admin.
- In the Property column, click Data Streams and open the data stream
- Click Measurement Protocol API secrets
- Here you can create a new API secret and give it an alias.
- Now that your new API secret is created, be sure to copy the secret value.
- Paste this value into the corresponding field in your admin
Attribute mapping
This section allows to configure data in the tracking events.
Option | Description |
---|---|
Track Brand on the Category pages | Enable it to track the relevant brand attribute on category pages. |
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. |
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.
Tag Manager
Some of the extension's settings are now available on the Tag Manager tab of its settings page.
Option | Description |
---|---|
Product identifier | Set the attribute that will be used for product tracking. Select from ID, or SKU. |
Identifier resolution | Select a parent or child product to track.. |
Track view catalog page event | Set Yes to track catalog pages. |