Google Tag Manager (GTM)

As low as $499.00
Available
Only %1 left
SKU
Google Tag Manager (GTM)

Google Tag Manager implementation for ScandiPWA, supporting Google Analytics Enhanced Ecommerce

 

Please note that the support for GA4 has been implemented exclusively for the following versions: 2.4.4-p2 Magento 6.1.1 SPWA, 2.4.5-p4 Magento 5.3.3 SPWA

DISCLAIMER

This extension is standalone. It provides all necessary ScandiPWA and Magento modules. No third-party modules are required.

Features

Built-in GTM [GA4] events 

GA4 has been implemented exclusively for the following versions: 2.4.4-p2 Magento 6.1.1 SPWA, 2.4.5-p4 Magento 5.3.3 SPWA

 Full support of the following events is included:

 

Built-in GTM events

Full support of the following events is included:

No support for the following event categories is planned:

The support for additional custom events is included:

  • User authorization tracking
User has logged in

{
"event": "userLogin",
"customerId": "123",
"customerEmail": "GHFHHsdas",
}

User has registered {
"event": "userRegister",
"customerId": "123",
"customerEmail": "GHFHHsdas",
}

 

  • Search results
Search was started {"event": "siteSearchStarted"}
Search results were returned

{
"event": "GAevent",
"eventCategory": "siteSearch",
"eventAction": "<Results loaded|No Results Found>",
"eventLabel": "<SEARCH STRING>",
"eventNonInteraction": 0,
}

 

  • Not found pages
The 404 page was shown

{
"event": "notFound",
"eventCategory": "404 pages",
"eventAction": "<URL>",
"eventLabel": "",
"eventNonInteraction": 1
}

 

  • Page reload
The page was reloaded

{
"event": "pageReload",
"timeOnPage": 11.4,
"userInitiated": false,
}

 

  • Filtration tracking
The filter was modified

{
"event": "filter",
"filterGroup": "Color",
"filterId": "46",
"filterName": "Coral Blue",
"filterResults": 2,
"filtersApplied": "Gender:Female,Sport:Ski"
}

 

  • Sorting tracking
The sorting was modified

{
"event": "sort",
"sortDirection": "DESC",
"sortKey": "Price",
}

 

  • Wishlist tracking
Product added to wishlist

{
"event": "addToWishlist",
"id": "231",
"name": "Product name",
"position": 1,
"price": 24.95,
"quantity": 2,
"variant": "N/A",
"brand": "Nike",
"sortKey": "Price",
}

Product removed from wishlist

{
"event": "removeFromWishlist",
"id": "231",
"name": "Product name",
"position": 1,
"price": 24.95,
"quantity": 2,
"variant": "N/A",
"brand": "Nike",
"sortKey": "Price",
}

 

  • Error messages
The error notification was shown

{
"event": "errorMessage",
"message": "Something went wrong!",
}

 

Custom dimensions and metrics

Any amount of custom dimensions or custom metrics could be added. Dimensions and metrics will be included in the product-related events payload. More specifically, dimensions are applied to the following events:

  • Measuring Product Impressions
  • Measuring Product Clicks
  • Measuring Views of Product Details
  • Measuring Additions or Removals from a Shopping Cart

Batching of products for impression event

You can select the amount of products to be batched under one impression event. Must be a number between 1-24.

Configuration

Initial configuration

To configure the extension:

  1. In the admin panel navigate to Stores → Configuration → ScandiPWA → Google Tag Manager → General Configuration.
  2. Enable the module and input your GTM ID. To obtain your GTM ID, visit https://tagmanager.google.com/, select your GTM account, then, copy the GTM ID from the top-right corner of the header.

Managing events

Available DataLayer push events can be enabled under the Stores → Configuration → ScandiPWA → Google Tag Manager → DataLayer Push Events Configuration. By default, all events are disabled.

Managing custom metrics and dimensions

The support for custom dimensions is added. They can be configured from Stores → Configuration → ScandiPWA → Google Tag Manager → Additional Configuration. There, you can add any amount of custom dimensions or custom metrics. The value of the dimension/metrics could be an attribute value of the parent or child product or a custom value. 

It is important to name variables properly. For dimensions, the format is: “dimension<N>” where n is a natural number, for example, “dimension1”. For metrics, the format is “metric<N>” where n is a natural number, for example, “metric3”.

More information on custom metrics and dimensions could be found in the official guide:

Debugging

Checking if GTM is enabled

  1. Navigate to the Homepage. Open browser development tools. Switch to the network tab.
  2. Filter results by name gtm.js
  3. If the response status code is 200, the GTM is working. If not, then make sure that your GTM ID is correct and it has been published at least once with some tags.

Validating the data layer pushes

  1. Use an extension that can show information about data layer pushes, for example, Adswerve - dataLayer Inspector+ for Google Chrome.
  2. In the case of this extension, information about all pushes can be seen in the browser's console, for example, there should be a Google dataLayer.push(): event: general.
  3. To see more information, click on the console message to show more information about the selected push.

Development

Implementation

Since version 2.0.0 (for ScandiPWA ^5.2.6, refer to README.md in older versions for development hints), the Extension does not utilize Redux anymore. Events can be dispatched from anywhere by calling functions defined in the src/event folder. The data for events is collected from the store outside of the components. The data collection logic is located in the src/data folder. The plugins that are responsible for event firing are located in the src/plugin/events folder. The mapping of events to their implementation folders are located in the src/util/events, in comments.

More Information

More Information
Product Name Google Tag Manager (GTM)
Short Description

Google Tag Manager implementation for ScandiPWA, supporting Google Analytics Enhanced Ecommerce

 

Please note that the support for GA4 has been implemented exclusively for the following versions: 2.4.4-p2 Magento 6.1.1 SPWA, 2.4.5-p4 Magento 5.3.3 SPWA

Base /f/r/frame_78.png
Small /f/r/frame_78.png

Reviews

Write Your Own Review
You're reviewing:Google Tag Manager (GTM)
Copyright © 2013-present Magento, Inc. All rights reserved.