Extension for Magento by Anowave
Google Analytics 4 for Magento 2 based on Google Tag Manager. Provides a full support for the Google Analytics 4 specification and allows for advanced Enhanced Ecommerce tracking for Magento 2 via the visionary GA4. The new Analytics adds AI-powered insights, tracks users across devices and provides more granular data controls.
Requires Magento 2 Google Tag Manager Enhanced Ecommerce (UA) Tracking
Magento 2 Google Analytics 4 (GA4 based on Google Tag Manager) is an extension that works on top of our famous Magento 2 Google Tag Manager Enhanced Ecommerce (UA) Tracking extension. It modifies the dataLayer[] object so it can meet the new Google Analytics 4 specifications. The module implements all Google Analytics 4 (GA4) ecommerce features using Google Tag Manager. Being based on our GTM module, it provides a full range of additional features such as AdWords Dynamic Remarketing, AdWords Conversion Tracking, Social Network interaction tracking, Facebook Custom Audiences Pixel, Custom Dimensions, Google Customer Reviews, User ID data acquisition and User Timings Tracking.
This module cannot work as standalone module, it works on top of our Magento 2 Google Tag Manager Enhanced Ecommerce (UA) Tracking extension. This allows you to not only have GA4 but also the entire world of Enhanced Ecommerce tracking, AdWords Dynamic Remarketing, Facebook Pixel tracking etc. All of them managed by a single extension.
All our products come with a 6 full months (180 days) of premium support. To report a bug, use our Premium Help Desk available in your account at Anowave.
We had a few issues with the API configuration mainly due to some wierd quota limitation by Google themselves but other than that with this extension we were able to switch to GA4 with ease. I'd like to thank the support team for all they did for us and helping us with the configuration. Spot on!
Yes, I recommend this product
Works as described. It kept all the settings we had previously configured in the UA module which is awesome. Had to update the main module to latest version but that's understandable. Good work!
Yes, I recommend this product
We have used Anowave's GTM solution for years and this was a natural choice. It's well designed, well maintained and the support is perfect. The GA4 module blends with the GTM one almost unnoticeably, we manage our stuff from where we used to. There were a few issues but they were mainly configuration oriented and the team helped quickly. Strongly recommend Anowave.
Yes, I recommend this product
This is the only solution that worked for us with this crazy new GA4. The only disappointing bit was that we had to purchase their GTM module as well in order to run GA4 but the price tag was still fine for what we got.
What I like most is that dataLayer[] object is initialized for both GTM UA and GTM GA4 which is what we were looking for.
Support is premium, very polite and responsive. Keep up the good work!
Yes, I recommend this product
This extension can be installed in a few minutes, by going through the following steps:
Enhanced Ecommerce tracking is done by sending enhanced measurement events via the so called Google Analytics 4 Event tag. We have outlined some of the essential events supported by the module which are sufficient for proper Enhanced Ecommerce tracking.
view_promotion
Measures promotion view
select_promotion
Measures click on a promotion
view_item_list
Measures product/item list views/impressions
select_item
Measures product click (from categories)
view_item
Measures product detail views
add_to_cart
Measures click on "Add to Cart" button
add_to_wishlist
Measures click on "Add to Wishlist" button
remove_from_cart
Measures click on "Remove from cart" button
view_cart
Measures cart view
begin_checkout
Measures checkout start
add_shipping_info
Measures selected shipping method
add_payment_info
Measures selected payment method
purchase
Measures transactions on success page
refund
Measures refunds (not implemented yet)
The Google Analytics: GA4 Configuration tag initializes Google Analytics for your Google Analytics 4 property on a particular page. It handles behavior such as setting of Google Analytics cookies, sending automatic and enhanced measurement events, and declaration of common settings. In effect this is the tag that does 90% of the work and installs Google Analytics 4 on the site.
The built-in API will create this tag for you automatically
Anowave_Ec4 module works on top of our Anowave_Ec module, it's designed to modify the dataLayer[] object as per GA4 specification (https://developers.google.com/tag-manager/ecommerce-ga4)
When installed:
1. A new field called Measurement ID appears in Google Tag Manager API configiration section. This is obtained from Google Analytics 4 and it's in the following format: G-XXXXXXXXXX
2. A 3 new checkboxes appear that allow you to:
a) Create GA4 variables
b) Create GA4 triggers
c) Create GA4 tags (creates also the Google Analytics 4 configuration tag)
3. Google Analytics 4 Configuration tag
The Google Analytics: GA4 Configuration tag initializes Google Analytics for your Google Analytics 4 property on a particular page. It handles behavior such as setting of Google Analytics cookies, sending automatic and enhanced measurement events, and declaration of common settings. This is in effect what tracks Pageviews and installs Google Anlaytics 4 on your site
4. dataLayer[] modifications
dataLayer[] object gets modified as per GA4 specification (https://developers.google.com/tag-manager/ecommerce-ga4)
5. To our understanding, it's better to create a new empty container and use the API to configure it for GA4 by clicking only the GA4 checkboxes from our API, this will create the GA4 variables,triggers and tags including the Google Analytics 4 Configuration tag. Having the container inflated with the old tags is not a mistake but they won't fire or if some of them fires it could duplicate and/or corrupt data.
6. There are certain limitations of GA4 (due to being in beta mode probably) to be aware of:
a) Checkout can no longer be tracked in terms of checkout steps. There are a few events dispatched:
begin_checkout
add_payment_info
add_shipping_info
b) Product list attribution no longer works, it's simply not available yet in GA4
c) There are no more product-scoped dimensions.
Configuration steps
Configuration is really simple but it will require some pre-config steps. In order to track stuff properly, you have to have a GTM container configured with the required tags/triggers and variables. You can do this configuration really easy using the built-in API. It requires no technical expertise whatsoever.
We have outlines a few configuration steps below required for module to work properly:
1. Install the module
2. Enter a license key in Stores -> Configuration -> Anowave Extensions -> Google Tag Manager GA4 and set Enable to "Yes"
3. Go to Stores -> Configuration -> Anowave Extensions -> Google Tag Manager and expand the Google Tag Manager API section
4. Enter your Account ID and click Sign in
5. Once singed in, pick the Container ID which you want to configure. It is recommended to configure an empty/new container to avoid messing with UA tags
6. Enter your Measurement ID
7. Click ONLY GA4 related checkboxes e.g. Create variables (GA4)/Create triggers (GA4)/Create tags (GA4). Make sure not to click the first 3 checkboxes because they will create also standard UA tags in your container
8. Click "Save config" (note that saving could take a while so be patient)
When you activate GA4, UA will not work properly simply because dataLayer[] object is modified to match the GA4 specification in terms of event names, however we have designed the dataLayer[] to hold the data required by both UA and the GA4.
To run them both, a change is required in the triggers for UA tags. Since GA4 events are different, some of the event based tags in UA will not fire automatocally.
For example:
For example addToCart in UA is add_to_cart in GA4. Thus Event Equals Add To Cart trigger will not fire. To get the EE Add To Cart trigger working, you must change it's trigger from Event Equals Add To Cart to GA4 Event Equals Add To Cart. The same logic applies for other tags such as EE Remove From Cart etc.
Tag changes required:
If you plan to have GA4 and UA configured in separate containers, it is possible to add both snippets in the GTM head field from the configuration. This will load them both on frontend.
If installed properly, Google Tag Manager should contain (at minimum) the tags shown in the figure below.
Unlike Universal Analytics, testing Google Analytics 4 could be tricky and time consuming. We have prepared a few steps below to use as a guide on how to test and debug Google Analytics 4.
1. Prepare GTM for debugging
In order to start the debugging process you must prepare GTM for debugging. To do so, edit GA4 Configuration tag and under Fields to set add new Field with Field name: debug_mode and Value: true (as shown below)
Once done, Publish new container version so changes could take effect.
2. Run GTM in Preview mode
To run GTM in Preview mode, go to GTM and click Preview. You will be requested to enter your domain and from then on GTM will open a new debug window.
3. Open Google Anlaytics 4 DebugView
Go to Google Analytics -> Confiure -> Debug view. This will open GA4's debug view screen where you can observe the events fired in real time. If everything is set correctly, you should see your browser in DEBUG DEVICE dropdown.
If all 3 points above are done, you can now start testing. Browse the site as regular user, check what tags fire in GTM Preview console, check what events fire in DebugView in GA4. You can also place a test order and check if both EE4 Purchase tag is fired and the 'purchase' event is shown in DebugView.
Google Analytics 4 despite being new stuff, proved to be hard to work with and has potentially steep learning curve. We're learning new stuff ourselves everyday so let's check the following stuff that could be causing incorrect reports.
Function-wise our extension is designed and working as per Google's specifications displayed here - https://developers.google.com/tag-manager/ecommerce-ga4
dataLayer[] object is initialized with all the required parameters and the payload that is being pushed for every event meets the requirements.
Still, there are few things that could be causing missing or invalid data in your GA4 property.
EE AdWords Dynamic Remarketing
EE4 Add Payment Info
EE4 Add Shipping Info
EE4 Add To Cart
EE4 Add To Compare
EE4 Add To Wishlist
EE4 Begin Checkout
EE4 Purchase
EE4 Refund
EE4 Remove From Cart
EE4 Select Item
EE4 Select Promotion
EE4 View Cart
EE4 View Item
EE4 View Item List
EE4 View Promotion
GA4 Configuration
2.3 Edit EE4 Purchase tag and check if ALL of the following Event parameters are set.
Missing 'currency' parameter will cause revenue to show as $0.00 instead of the actual revenue.
If you like this product, share it with your friends
Anowave is an extension developer for Magento 1.x and Magento 2.x platforms. We provide a wide range of premium extensions for our in-house and public clients. The extensions that we offer extend the capabilities of Magento and provide a bespoke functionality. They also fill some missing gaps in the functionality provided by the base platform and help customers in chosing Magento as prefered ecommerce platform.
The extensions that we offer are part of our full range Magento service which includes also a Premium Helpdesk where customers get to speak with actual software engineers and get their issues resolved without hussle. Premium labeled modules also include free installation, confiuration, testing etc.