Stand with Ukraine! How can you help?
Find out more

Magento 2 Google Tag Manager | GA4 & Ads Support

Magento 2 Google Tag Manager is a Magento 2 extension that allows you to connect your store with Google Tag Manager, Google Analytics 4 and Google Ads without code editing or manual tracking scripts.

It tracks 13+ essential Commerce events, providing detailed insights into conversions, customer behaviour, checkout performance and product-level results.

Magefan Google Tag Manager covers everything from full-funnel tracking and dynamic remarketing to enhanced conversions and server-side tagging, so you can make data-driven marketing decisions based on reliable data.

  • Track every action customers take on your store (13+ eCommerce events)
  • Pre-built data layer for web and server containers
  • Google Tag Gateway support
  • Client-side and server-side tracking (GTM server container or Measurement Protocol)
  • Google Ads Remarketing / Conversion Tracking / Enhanced Conversions
  • Fast Magento GTM loading
  • Cookie Consent (GDPR) compliant - Google Consent Mode support
  • Hyvä Theme & Hyvä Checkout compatibility
  • Compliance with Magefan Cookie Consent
  • No code editing or technical skills needed
Pricing plans:
Compare Plans and Pricing
Regular Price $79 Special Price $0
one-time payment
Add to Cart
Magefan Google Tag Manager is trusted by 3,000 stores and has been downloaded more than 80K times.
FREE version available
magento 2 google tag manager
set up google tag manager in magento
add google analytics 4 to magento
magento google tag manager data layer
Live DemoLive Demo
Compatibility:Magento 2.3.0 - 2.4.8-p3 (CE, EE, ECE, B2B)
Version:2.7.4

Why use Google Tag Manager Extension in Magento?

Data tracking with Google Tag Manager in Magento is more accurate and reliable with a dedicated Magento 2 extension.

set up google tag manager in magento

Set up Google Tag Manager, GA4 and Google Ads in Minutes. Not Hours.

Setting up Google Tag Manager for Magento, along with GA4 and Google Ads, shouldn’t take hours or require a developer. And Magefan GTM Extension for Magento proves it.

Just insert tracking IDs in the admin and export a pre-built data layer.

It already contains all tags, triggers and variables you need to connect to all Google tracking tools.

No more code editing or tracking scripts. Set up GTM and Google Analytics 4 for your store fast and focus on your business goals. We’ll handle the tracking.

Track Entire Customer Journey — From Clicks to Purchases

Every click, page visit or purchase tells a story about your customers. Without proper tracking, these stories get lost.

Magento 2 Google Tag Manager Extension helps you get a full picture, so you can:

  • - See where traffic lands (page_view)
  • - Understand how people browse (view_item_list)
  • - Measure product engagement (view_item)
  • - Optimise retargeting (add_to_cart/remove_from_cart)
  • - Recover abandoned carts (beging_checkout,add_pageyment info/add_shipping_info)
  • - Track sales accurately (purchase)
  • - Understand returns better (refund)


Track the entire customer journey. Identify the bottlenecks. Fix the issues that cost you sales more effectively.

track customer journey magento
track ecommerce events in magento store

Know Exactly What Works and What Doesn’t

Guessing which products drive sales, where customers drop off or what coupons generate the most revenue is expensive.

Magento Google Tag Manager gives you certainty. It tracks every crucial detail in your store automatically:

  • - Product performance: which products are viewed, added to the cart/wishlist, abandoned or purchased
  • - Checkout performance: what checkout step causes cart abandonment
  • - Customer store behaviour: how customers register, log in, search and interact with your store


This data allows you to make informed decisions, refine your campaigns and optimise where it matters most.

Build Custom GA4 Reports to Analyse What Matters

Default GA 4 reports rarely show the full story. Key details about customers, orders, pages and traffic sources are often hidden or missed entirely.

Magento GTM Extension sends rich event parameters with every interaction. So, why not use it to customise your reports?

Analyse performance based on item IDs, tax and shipping amounts, page types, customer IDs and multiple other details. No custom tagging, no manual work.

Turn raw tracking data into actionable insights to optimise with confidence.

google tag manager event parameters
magento server side tracking

Track Data Even When AdBlockers Block You

Cookie restrictions and ad blockers often cause lost revenue and inaccurate reports.

But they won’t, if you enable the server-side tracking in Magento through GA4 Measurement Protocol or GTM Server Container.

This Magento 2 Google Tag Manager extension to switch from client-side easily. Use server-side tagging to capture missing purchases only or the entire funnel.

Make smarter marketing decisions based on reliable and complete data. Not assumptions.

Note: want the same result but without the complexity of a server set-up? Try Google Tag Gateway.

Get data tracking to the next level

Optimize your online impact by gaining valuable insights into your store performance

Benefits of the Magefan Google Tag Manager for Magento

Magefan Google Tag Manager for Magento 2 makes data tracking more accurate, scalable and performance-safe, delivering multiple benefits for growing stores.

Optimise Your Google Ads Campaigns

Incorrect attribution and missing conversion drain your budget quietly. So, when ad performance drops, it’s not about the strategy. It’s about the data behind it.

But you can still fix that at the source — with the Magento Google Tag Manager.

  • - Track ads that drive the most orders with conversion tracking.
  • - Return visitors who leave with dynamic remarketing.
  • - Capture customers’ email addresses securely with Enhanced Conversions.


Feed your Google Ads only reliable data to use your marketing budget more effectively.

magento google ads conversion tracking
magento gtm cookie compliance

Track Data Safely and Stay Compliant

Tracking data should help your customers in their journeys, not risk your business.

Magefan Google Tag Manager for Magento has you covered with an automatic consent logic.

Just enable Google Consent Mode or default Magento Cookie Consent options to trigger GTM loading only after consent.

Stay compliant, avoid penalties and keep tracking both ethical and accurate.

Note: this extension is fully compatible with the Magento 2 Cookie Consent Extension.

Optimize Campaigns for Each Market

Keeping up with every store, currency and store view is challenging. Especially if you run a separate campaign for each of them.

Our Magento 2 Google Tag Manager brings clarity and structure. It allows you to assign each store view to a different GTM container. Within a single setup.

See exactly how each market performs, which campaigns convert best, and where to invest your budget next.

Improve market attribution and make smarter decisions about every region you target.

multi store gtm tracking magento
google tag manager magento hyva theme

Integrate Seamlessly and Stay Future-Proof

The easier it is to scale your tracking, the faster you grow. Magefan makes sure you can do that without any extra steps.

Our Magento GTM Extension integrates directly with your admin panel, supports headless PWA storefronts, Hyva frontend and works with custom GTM loaders.

Track data the way you want, where you want it, and switch between the tracking methods without a headache.

Magefan GTM is a simple, flexible and future-proof path to data tracking.

Track Better — Without Sacrificing Performance

Adding tracking scripts to your store usually slows down performance, making you choose between data and experience.

Magefan Google Tag Manager for Magento doesn’t want you to face this choice.

Load tracking scripts only after users interact — scroll or click.

Collect all the data you need while delivering a seamless UX, performance and SEO.

google tag manager script loading magento

The most common questions about the Magento Google Tag Manager

What does the Magento 2 Google Tag Manager extension do?
collapsible icon
This extension connects Magento with Google Tag Manager, GA4, and Google Ads using tracking IDs, not code snippets. It comes with a pre-built data layer, so you can automatically track essential eCommerce events without creating tags, triggers and variables manually.
Does Magento support Google Analytics 4 natively?
collapsible icon
No. Magento doesn’t fully support GA4 enhanced eCommerce by default. You need the Magefan Google Tag Manager extension to enable proper GA4 and GTM tracking with a pre-built data layer.
What events does the GTM extension track?
collapsible icon
The extension tracks view item, select item, view item list, add to cart, view cart, remove from cart, add to wishlist, begin checkout, add shipping info, add payment info, purchase, refund, login, sign up, form submit, file download, click, scroll and search events.
Do I need a developer to set up Google Tag Manager in Magento?
collapsible icon
No. The setup is done entirely in the admin panel using only tracking IDs and pre-built JSON files. Once you import the pre-built JSON file to your GTM account tracking starts automatically.

However, you might need a developer to install the extension.
What customer params do you pass to the datalayer?
collapsible icon
The extension passes parameters such as customer ID, first and last names, telephone, email, postcode, city, region and customer group, depending on the event and consent settings.
How do you know if Google Tag Manager is working?
collapsible icon
Once you import the JSON file to your GTM account, open the debug view and trigger different events in your store. Besides, there are also other ways to test if GTM is working.
Does this extension support server-side tracking?
collapsible icon
Yes. Our GTM Extension supports GTM Server Container, GA4 Measurement Protocol, and Google Tag Gateway for more accurate and reliable data tracking.
How to install the Magento 2 Google Tag Manager extension?
collapsible icon
You can install the Google Tag Manager in Magento using this command:
composer require magefan/module-google-tag-manager
and then run the composer update commands. Alternatively can upload an extension archive to your Magento folder.

If you've purchased the Magefan Google Tag find the installation instructions in your Magefan account under the "My Downloads" section.
Is the extension compatible with Google Consent Mode and GDPR?
collapsible icon
Yes. It’s compatible with Google Consent Mode, Magento native cookie consent feature, and Magefan Consent Mode Extension and collects data only after consent.
Can this GTM extension send data from different store views to separate GTM accounts?
collapsible icon
Yes, Magefan Google Tag Manager fully supports multi-store and multi-currency setups. So, you can set up different GTM containers per store view for region-specific tracking.
Is Magento 2 Google Tag Manager Extension free?
collapsible icon
Yes. Magefan Google Tag Manager for Magento comes with a free plan for basic functionality and GTM events and two advanced paid plans that offer more data control and tracking options.

People Also Searched For
magento google tag manager
magento 2 google tag manager
google tag manager extension magento
google tag manager extension magento 2
google tag manager extension
google tag manager magento extension
google tag manager magento 2 extension
google tag manager magento 2
google tag manager for magento 2
magento 2 google tag manager
gtm magento
magento 2 gtm extension
gtm magento 2
Quick Overview Video

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

Watch this short video to learn how to add GTM to Magento in a few clicks.
 
What our clients say
Magento 2 Google Tag Manager Extension
Live Demo
chevron-up Top