Google Analytics 4
Full GA4 ecommerce tracking through checkout, without hand-wiring data layer pushes.
Most GA4 setups on Magento are either a bare page-view tag or hours of hand-coded data layer pushes that break the next time the theme changes. This module sends the full GA4 recommended ecommerce event set automatically, read from Magento's own cart, checkout, and search data, not a theme-specific click handler, with Google Consent Mode v2 defaults built in.
Features
- Full GA4 ecommerce funnel, from view_item_list to purchase
- Direct GA4 or Google Tag Manager, switchable without touching code
- Google Consent Mode v2 default state built in
- Debug Mode shows every event in the browser console before you trust the numbers
One-time payment for the term you choose, covering updates & support for that long. It doesn't auto-renew; renew any time from your dashboard.
Compatibility
Magento 2.4.4 and newer
PHP 8.1, 8.2, 8.3, 8.4
Hyvä compatible
Lifetime access to source code
Free support & updates for 1 year
30-day money-back guarantee
More about Google Analytics 4
The problem
A Magento store without real GA4 event tracking is flying blind on the parts of the funnel that matter most: how many people add to cart versus how many actually complete checkout, which products get viewed but never purchased, where shoppers drop off between shipping and payment. Wiring this up by hand means writing theme-specific JavaScript for every checkout step and hoping it survives the next theme update.
How it works
This module renders the events tied to a single page load (view_item_list, search, view_item, view_cart, begin_checkout, purchase) directly from data already available on the server at render time. The rest are real client-side actions, but each one is tied to a Magento signal that holds true on any theme rather than a theme-specific click handler:
add_to_cart/remove_from_cartcome from diffing the shared "cart" customer-data section before and after each change, since every cart mutation on any theme refreshes itselect_itemcomes from matching a clicked link's href against the product URLs the listing page's ownview_item_listrender already seededadd_shipping_info/add_payment_infocome from watching for a successful call to Magento's own checkout REST endpoints, since every Magento checkout has to call these same core Web API endpoints to progress
Consent and tracking mode
Google Consent Mode v2 defaults go out before the tracking loader runs, so a store can add a cookie banner tool later that simply calls gtag('consent', 'update', ...) on top of this baseline rather than building consent handling from scratch. Tracking mode itself is a single admin setting: GA4 loads gtag.js directly against a Measurement ID, or Google Tag Manager loads your container and pushes events to its own dataLayer.
What you see in GA4
With Debug Mode on, every event this module sends shows up in GA4's DebugView in real time, plus a console log of the same pushes, so you can confirm the funnel is wired correctly before trusting the numbers in reporting.
Configuration
Where to find it in the Magento admin
Every setting lives under Stores > Configuration > Nextbyte > Google Analytics, grouped as follows:
| Section | What you can set |
|---|---|
| General | Turn tracking on, choose GA4 or Google Tag Manager as the tracking mode, enter your Measurement ID or Container ID depending on the mode chosen, and turn Debug Mode on or off |
| Ecommerce Events | Choose whether products are identified by ID or SKU, and whether shipping and tax are excluded from the purchase value sent to GA4 |
| Consent Mode | Turn default consent signals on, set the default state for ad storage and analytics storage, and an optional wait for update setting |
There is no separate admin grid or dashboard for this module. Everything is controlled from Store Configuration, and tracking begins immediately once enabled with a valid Measurement ID or Container ID entered.
Reviews
No reviews yet.
One-time payment for the term you choose, covering updates & support for that long. It doesn't auto-renew; renew any time from your dashboard.
Compatibility
Magento 2.4.4 and newer
PHP 8.1, 8.2, 8.3, 8.4
Hyvä compatible
Lifetime access to source code
Free support & updates for 1 year
30-day money-back guarantee