Google Tag Manager & Consent Mode vs Yireo GoogleTagManager2: a data layer, or a guarded loader
Yireo GoogleTagManager2 is free and pushes fifteen GA4 ecommerce events to the dataLayer. Google Tag Manager & Consent Mode is free too, pushes none, and instead guards staging, the strict-CSP checkout and Consent Mode v2. Both load the container, so the choice is one or the other.
ComparisonYireo GoogleTagManager2 is the Tag Manager module most Magento stores already know: free, open source, and installed about 36,000 times a month from Packagist. Google Tag Manager & Consent Mode is ours, and it is free too. Both put a Google Tag Manager container on the storefront, but they are built around different problems, and the choice mostly follows from which problem you have.
Everything about Yireo and elgentos below was read on 2026-10-10 from the vendors' own repositories, documentation and Packagist, linked at the end. Versions move; check the vendor's page before you install.
The short answer
Choose Yireo GoogleTagManager2 if you want GA4 ecommerce reporting – product views, cart, checkout steps and purchases pushed to the dataLayer – without building that data layer yourself, if you run Hyvä Checkout or Loki Checkout, or if you need more than one container.
Choose Google Tag Manager & Consent Mode if your tags live in Tag Manager and you need the container to stay off on staging copies of the database, to keep working on the strict-CSP checkout, and to start with Consent Mode v2 defaults – without a separate consent module.
Both modules load the container. Installed together, the page would load it twice, so pick one loader.
Side by side
| Google Tag Manager & Consent Mode | Yireo GoogleTagManager2 | |
|---|---|---|
| Price and licence | Free, with all future updates; OSL-3.0 | Free, OSL-3.0 |
| What it adds | A guarded loader: staging guard, strict-CSP checkout, Consent Mode v2 | A GA4 data layer and the loader |
| GA4 ecommerce events | None | 15, from view_item_list to purchase; refund left to a server-side setup by the vendor's own advice |
| Loads only on listed production hosts | Yes; an empty list loads nothing | No such setting is documented or present |
| Nonce on gtm.js on the strict-CSP checkout | Yes, plus a cspNonce dataLayer value for Custom HTML tags | Not documented; the 3.10.8 source loads gtm.js without one |
| Tag hosts added to the storefront CSP from the admin | Yes | Google Tag Manager and Analytics hosts only, fixed in the module |
| Consent Mode v2 | Built in: regional defaults before the container; updates from Magento's cookie notice or a consent platform | Not built in; GitHub issues asking for it have been open since 2023 and 2024 |
| Custom container URL (server-side Tag Manager) | Yes | Yes |
| More than one container | No | Yes |
| Load after first user interaction | No | Yes |
| Hyvä Theme | Yes, built in | Yes, built in |
| Hyvä Checkout / Loki Checkout | Not tested | Yes, through separate free modules |
| Release | 1.0.0, 2026-10-09 | 3.10.8, 2026-10-09 |
| Adoption | New | About 1.1 million Packagist installs, 168 GitHub stars |
Where Yireo GoogleTagManager2 is the better choice
It does the larger job. Fifteen GA4 events, with product and category attributes you choose, are what GA4's ecommerce reports are built on, and Yireo gives them away. It loads several containers, can wait for the visitor's first interaction before loading, and has bridges for Hyvä Checkout and Loki Checkout. Years of use on a very large number of stores stand behind it.
If you need GA4 ecommerce data and none of the three problems below has bitten you yet, Yireo is the obvious first thing to try.
Where Google Tag Manager & Consent Mode differs
It is built around three problems that a snippet pasted into the HTML Head leaves open.
- Staging copies. Staging and local environments run on copies of the production database, so the container comes along with the data and test orders reach the real Analytics and Ads accounts. This extension loads the container only when the store's base URL host is on your list of production hosts.
- The strict checkout. Since 2.4.7, Magento runs the checkout with inline scripts switched off. This extension sets the page's nonce on gtm.js, pushes it to the dataLayer as cspNonce for Custom HTML tags, and adds the hosts your tags use to the policy from the admin.
- Consent order. Google Consent Mode v2 expects its defaults before the container loads. This extension sets them in the same script – every signal denied in the EEA, the UK and Switzerland, your choice elsewhere – and updates them from Magento's own cookie notice on Luma and Hyvä Theme, or leaves updates to your consent platform.
The cost of that focus is stated in our FAQ: no ecommerce events, nothing sent from the server, one container.
elgentos ConsentMode-v2, for Hyvä stores
elgentos publishes a free consent module for Hyvä Theme that replaces Hyvä's cookie bar with a Deny / Customize / Allow All banner and maps four consent categories to Consent Mode signals. Its documented defaults are not regional. It is not a Tag Manager loader and is used next to one.
So Yireo plus elgentos is a free way to get a data layer and a consent banner on Hyvä. What it does not add is the staging guard and the checkout nonce. If you need a consent banner with per-category choices, elgentos has one and we do not.
Sources, read 2026-10-10
- Yireo GoogleTagManager2: https://github.com/yireo/Yireo_GoogleTagManager2 (README, USAGE.md, FAQ.md, release 3.10.8), issues https://github.com/yireo/Yireo_GoogleTagManager2/issues/222 and https://github.com/yireo/Yireo_GoogleTagManager2/issues/198, https://packagist.org/packages/yireo/magento2-googletagmanager2
- Yireo Hyvä Checkout bridge: https://github.com/yireo/Yireo_GoogleTagManager2HyvaCheckout
- elgentos ConsentMode-v2: https://github.com/elgentos/magento2-consentmode-v2, https://packagist.org/packages/elgentos/magento2-consentmode-v2
More on how Google Tag Manager & Consent Mode works is in its documentation. The extension is on its product page.