Using Google Tag Manager for Google Universal Analyticsc in Magento

This documentation is for both GUA Mage1 and GUA Mage2 extensions

Magento configuration

First, go to Google Universal Analytics configuration section. Then, enable Google Tag Manager (note that Analytics part should be enable too, and the UA ID filled.)

Then you can - or not - add the GTM container tag. If you have already setted up GTM manually or via another extension, then you can let this option off. In the other case, you should enable it, and fill the GTM Container ID (You got that ID by creating a container in GTM).

Google Tag Manager configuration

You'll need two tags so our extension can work with GTM : Pageviews Tag and Events Tag



Pageviews Tag

Easiest first, the pageview tag. You just need to create a tag with this configuration :

  1. Tag type : Universal Analytics
  2. ID : Your GUA ID (UA-XXXXXX-X)
  3. Hit Type : Pageview
  4. Enhanced ecommerce checked and "Use data layer" checked. (Optional but recommended. Should match your GA/Magento's configuration)
  5. Trigger : All pages


Events Tag

For this tag you will need to create data layer variables and a custom event.

Data layer variables are :

  1. eventAction
  2. eventCategory
  3. eventLabel
  4. eventValue
  5. eventNoInteraction


Custom event name is GAevent



Once it's done, you can create your GTM tag with this configuration :

  1. Tag type : Universal Analytics
  2. ID : Your GUA ID (UA-XXXXXX-X)
  3. Category : {{eventCategory}}
  4. Action : {{eventAction}}
  5. Label : {{eventLabel}}
  6. Value : {{eventValue}}
  7. Non-Interaction Hit : {{eventNoInteraction}}
  8. Enhanced ecommerce checked and "Use data layer" checked. (Optional but recommended. Should match your GA/Magento's configuration)
  9. Trigger : GAevent


Don't forget to save all your modification and to publish it before testing !