Why Do You Need Magento Google Tag Manager?
Magento doesn’t support Google Tag Manager integration or Google Analytics 4 enhanced eCommerce tracking by default. Without it, your reports on products, checkout performance and ad campaigns are incomplete. Magefan Google Tag Manager extension allows you to track rich product, order and customer data through 13+ eCommerce events and send them to Google Tag Manager, Google Analytics 4 and Google Ads automatically.
Track Product Performance
Monitor Customer Behaviour
View Checkout Performance
Build Custom GA4 Reports
Track Data Even With AdBlockers
Get Rich Google Ads Tracking
Track Data Reliably with Magento 2 Google Tag Manager Extension
Google Tag Manager for Magento is a reliable solution for data tracking that is built for speed, accuracy, compliance and scale. It replaces manual GTM script management with the pre-built data layer and automatic container generation for both web and server-side tracking on multi-store and multi-currency setups.
Integrate Google Tag Manager with Magento in Minutes
Skip code editing and manual GTM script management in your website's tag. Magento Google Tag Manager Extension allows you to integrate GTM directly in the admin without any developers involved.
Just create a web or server GTM container and add your GTM container ID, account ID, public ID, and GA4 Measurement ID in the admin.
Export the ready-made data layer with all the tags, triggers and variables to your GTM account and start tracking immediately.
Track 13+ eCommerce Events
Magefan GTM module track all important eCommerce events along with multiple order, customer, item and page details with each event, out of the box. No additional setup required.
- - Browing events:page_view, view_item_list, select_item, view_item.
- - Cart events: add_to_cart, view_cart, remove_from_cart, add_to_wishlist.
- - Checkout events: begin_checkout, add_shipping_info, add_payment_info.
- - Revenue events: purchase, refund.
- - Engagement events: login, sign_up, search, scroll, scroll_depth, file_download, click, form_submit.
Use Pre-built Magento Data Layer for GTM
No need to build a GTM data layer for Magento from scratch. Magento 2 Google Tag Manager Extension comes with pre-built data layers for both web and server containers that connect your Magento with GTM, GA4 and Google Ads.
- - Order data: transaction ID, value, tax, shipping, currency, coupon, items, shipping description, virtual product status, customer status and ID.
- - Product data: ID, name, URL, brand, categories, price, quantity, discount, coupon, variant and index.
- - Customer data: identifier, names, email, telephone, city, region, postcode, gender, country and customer group, depending on consent settings.
Ensure Complete Google Consent Mode Compliance
Keep your tracking compliant and accurate with the built-in consent logic.
Magefan’s Google Tag Manager module for Magento works with Google Consent Mode, Magefan’s and native cookie settings out of the box.
Set consent to “denied” and fire GTM tags for web or server containers only after users accept cookies.
Delay GTM Script Loading
Collect data for GTM without sacrificing loading speed, SEO or user experience. Use Magento Google Tag Manager to delay GTM script loading until visitors interact with the page.
- - Load GTM script on scroll or click: load starters after the first interaction.
- - Track real visitors’ data: trigger GTM only for legitimate users.
- - Protect Core Web Vitals: keep vital speed score high.
Track Data with Multi-store GTM in Magento
Magefan Google Tag Manager fully supports multi-store and multi-currency setups to help you track relevant data across several markets without any complex setups.
Create and assign a different GTM container for each store view to keep campaigns separate by market, within one admin setup.
See exactly how each market performs, which campaigns convert best, and where to invest your budget next.
Enable Server-Side Tracking in Magento
Bypass browser restrictions, ad blockers and customers who don’t accept cookies to get accurate data using server-side tracking in Magento. All events with all parameters are tracked via the Magento server and sent to the Google servers, so no data is lost or broken. Magefan Google Tag Manager for Magento supports three server-side tracking methods: server GTM, GA4 Measurement Protocol and Google Tag Gateway, which you can easily configure directly from the admin.
Use GA4 Server-Side Tracking
Track Data via GTM Server Container
Enable Google Tag Gateway
Integrate Google Ads and Google Analytics 4 to Magento
Magento 2 Google Tag Manager by Magefan connects Magento with Google Analytics 4 and Google Ads from a one single extension, including Google Ads Enhanced e-commerce. The data goes to both platforms through one GTM container and the same data layer to ensure accuracy and consistency.
Connect Google Analytics and Google Ads to Magento
You don’t need a separate Magento Google Analytics 4 Extension to set up GA4 and Google Ads for Magento. All you need is to add your measurement ID, conversion and label IDs directly in your admin panel.
Magefan’s Google Tag Manager extension creates the right tags in your GTM container with all important triggers and variables.
Set up, trigger, and track data for all three Google channels with a single data layer export.
Set up Magento Conversion Tracking and Dynamic Remarketing
Connect Google Ads to Magento through GTM to fix attribution and get accurate conversion data via web or server-side tracking.
- - Measure purchases by campaign, ad group and items using Google Ads Conversion Tracking.
- - Build audiences from product views, items added to wishlists or removed from carts for smart Google Ads dynamic remarketing campaigns.
Use Built-in Google Enhanced Conversions
Send hashed first-party customer data, like email and region, to improve matching and bypass cookie restrictions.
Magento Google Tag Manager offers built-in Enhanced Conversions for Google Analytics 4 and Google Ads. All customer data is hashed before it’s sent to Google and respects the consent mode settings.
Recover missed orders and improve Google Ads with reliable data.
Get the Most Out of Data Tracking with Magento GTM Extension
Magefan Google Tag Manager with GA4 support includes not only basic GTM and GA4 setup, but advanced tracking settings for accurate order data, custom reports, product attribute matching and safe testing.
Use GA4 Custom Dimensions
Optimize Order Tracking
Test and Adjust Tracking Workflows
Magefan GTM module for Magento works with Hyvä, Hyvä Checkout, Breeze, GraphQL PWA, and headless storefronts, so you can switch between architectures and themes without breaking the existing GTM and GA4 setups. The extension also supports custom GTM loaders so you can use your own GTM head script and body noscript for tracking.
FAQs
Does Magento support Google Analytics 4 natively?
Does this extension support server-side tracking?
Is the extension compatible with Google Consent Mode and GDPR?
What customer params do you pass to the datalayer?
How do you know if Google Tag Manager is working?
Can this GTM extension send data from different store views to separate GTM accounts?
Is the extension compatible with Hyvä Theme and Hyvä Checkout?
What is the best Google Tag Manager Extension for Magento?
Is there a separate file for the server GTM container?
Note: you can’t use both web and server GTM containers for the same website. If you want to enable server-side tracking together with the web container, try using GA4 server-side Measurement Protocol or Google Tag Gateway within the GTM web container.
Can I add custom attributes to the GTM data layer with Magefan Google Tag Manager?
Does upgrading to the GTM Extension Plus or Extra plan break any existing functionality or cause any data mismatch issues?
ns. If you change any settings in the admin, you must export the updated web and import it to your GTM account once again. If you want to switch to a server GTM container, there should still be no data mismatch if the destination (GA4 and Google Ads) accounts and conversion labels and IDs are the same.
Does this Magento Google Tag Manager support the Meta Pixel?
Does this extension offer event deduplication when the browser-side and the Measurement Protocol purchase event are both sent?
Key features
No-code GTM & GA4 integration
Advanced conversion events
PlusServer-side tracking
ExtraGoogle Ads integration
PlusCustom events tracking
ExtraClient-side tracking (web container)
Google Tag Gateway
ExtraBasic event tracking
Enhanced Conversions
PlusReady-to-use data layer
Custom order data tracking
ExtraGDPR compliance
Extended data tracking
PlusAPI-based tracking
ExtraCustom dimensions (parameters)
ExtraTracking vital in-store data is easier if you use the right tools. Set up Google Tag Manager for your Magento 2 store and learn more about your customer's behaviour.
- Samples
- Google Tag Manager v2.8.1

