Google Tag Manager
v2.0.22

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.

image

Copy these GTM JavaScript code snippets.

image

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)-->)

image

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:

image

image

image

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:

image

Admin Operations Tracking

image

  • 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.

image

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.

image

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.

image

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.