Google Analytics 4 (GA4) PRO With GTM Support Magento 2
The ability to measure data efficiently is crucial in this day and age. With the Google Analytics 4 (GA4) With GTM Support Extension for Magento 2, you'll be able to monitor, record, and view important data for your eCommerce business directly in your Google Analytics account. Track your transactions, adds-to-cart, impressions, and overall user activity so you can make informed decisions when planning your next move!
Track product impressions by position in the Category Page
Track product clicks by position in the Category Page
Track product impressions by position in the Search Result Page
Track product clicks by position in the Search Result Page
Track product impressions by position in the Related, Up-sell and Cross-sell
Track product clicks by position in the Related, Up-sell and Cross-sell
Track the number of times a product was added to the shopping cart
Track the number of times a product was removed from the shopping cart
Track the number of times a product was included into the checkout process
Track the number of times a product was compared
Track the number of times a product was added to wishlist
Track each Checkout Step (billing, shipping, shipping options, payment options)
Track purchases with or without shipping and tax fees
Track Transactions Success Pages with Custom Success Page URLs
Track coupon usage
Track product Brand
Track internal Promotion Impressions
Track internal Promotion Clicks
Internal Promotion Widget
Support for IP anonymization to be in compliance with EU countries
Support for Display Advertising Features
Child Vs Parent (Send Parent Id or Child id cart, checkout and thank you page)
Multi Currency Ready
GDPR compliant with native magento accept cookie functionality
Multi Store Ready
Varnish Cache Ready
Full Page Cache Ready
8KB payload support
Order Success Page Total Calculation (subtotal / grandtotal)
Track Magento User ID
Track user type (customer group)
Google AdWords Remarketing Tracking
Google AdWords Conversion Tracking
Persistent Data Management
Exclude Orders with 0 Value from being tracked
Track product review count
Track product review score
Track stock status
Track Sale products
Track transactions by product variants (configurable product)
Track transactions by product custom options
Track custom dimension Page Type
Track custom dimension Page Name
Product level Custom Dimension / Metric sending (Send up to 5 product attributes to GTM)
1 minute installation GUI
1 Month free support included
Complete sales data, including refunds and repeat purchases
Compatible with headless setups and multi-stores
100% order accuracy between Magento and Google Analytics
Avoids missing orders
Avoids duplicate orders
Measurement Protocol Tracking for Purchase
Measurement Protocol Tracking for Refunds
Measurement Protocol Tracking for Sign Up and Login
Measurement Protocol Tracking for Item View
Measurement Protocol Tracking for Search
Measurement Protocol Tracking for View, Add and Remove from Cart
Measurement Protocol Tracking for Begin Checkout
Measurement Protocol Tracking for Add Shipping Info
Measurement Protocol Tracking for Add Payment Info
Hyvä Theme Ready
Face to face with the new generation: Google Analytics 4.
Google Analytics 4 is a new type of property which includes different reports than the ones Google has gotten us used to with Universal Analytics. Google Analytics 4 can be used for Websites, Apps or both at the same time, whereas Universal Analytics can only be used for Websites. In this day and age, information is key to pretty much everything, which means that keeping your existing Universal Analytics Property and setting up a new GA4-based property to run in parallel can elevate your information game to new heights and assure you make the most informed, data-driven decisions when steering your store into the future.
Our extension helps open up this new platform to Magento 2 with an integration that's easy to set up and deploy. It brings the powerful functionality and ease of use of our popular Google Analytics Enhanced eCommerce UA GTM Tracking extension to the GA4 platform so you can get ready for stepping into the future.
Features of the Extension.
- Track product impressions by position in the Category Page
- Track product clicks by position in the Category Page
- Track product impressions by position in the Search Result Page
- Track product clicks by position in the Search Result Page
- Track product impressions by position in the Related, Up-sell and Cross-sell section
- Track product clicks by position in the Related, Up-sell and Cross-sell section
- Track the number of times a product was added to the shopping cart
- Track the number of times a product was removed from the shopping cart
- Track the number of times a product was included into the checkout process
- Track each Checkout Step (billing address, shipping address, shipping options, payment options)
- Track purchases with or without shipping and tax fees
- Exclude Orders with 0 Value from being tracked
- Track Transactions Success Pages with Custom Success Page URLs
- Track coupon usage
- Track product Brand
- Track internal Promotion Impressions
- Track internal Promotion Clicks
- Internal Promotion Widget
- Child Vs Parent (Send Parent Id or Child id cart, checkout and thank you page)
- Multi Currency Ready
- GDPR compliant with native magento accept cookie functionality
- Multi Store Ready
- Varnish Cache Ready
- Full Page Cache Ready
- 8KB payload support
- Order Success Page Total Calculation (subtotal / grandtotal)
- Track Magento User ID
- Track user type (customer group)
- Google AdWords Remarketing Tracking
- Google AdWords Conversion Tracking
- Persistent Data Management
- Track product review count
- Track product review score
- Track stock status
- Track Sale products
- Track transactions by product variants (configurable product)
- Track transactions by product custom options
- Track custom dimension Page Type
- Track custom dimension Page Name
- Product level Custom Dimension / Metric sending (Send up to 5 product attributes to GTM)
Google Analytics Measurement Protocol (Pro Version Only)
With Google Analytics 4 PRO, you can keep track of every customer's journey from beginning to end. Combine server-side and client-side monitoring to follow the complete consumer journey. Sales, marketing, customer, and product performance data as well as recurring orders and refunds are all available.
- Works with GA4
- 100% accurate sales data, including refunds and repeat purchases
- Compatible with headless setups and multi-stores
How it works
All of your store pages will have the tracking script added by Client Side Tracking. The client ID from Google ensures that the user source and journey are tracked.
We then combine client-side (browser) tracking with measurement protocol server-side tracking to link marketing channels, web surfing behavior, and purchase behavior.
All server-side Measurement protocol tracking events are then sent to GA4. This means that every time a user activates one of your website's functions, an event is sent to Google Analytics, ensuring complete accuracy.
- Event capture for the checkout process, including sales and refunds/returns, is completed.
- When the user does not wait for the thank you page to load, we will still track their orders.
- When a user reloads, the site avoids double-tracking of the order status page.
Ecommerce events tracked via Measurement Protocol
- Sign Up
- View Item
- Add To Wishlist
- Add To Cart
- Remove From Cart
- View Cart
- Begin Checkout
- Add Payment Info
- Add Shipping Info
I Already have Universal Analytics, why do I need GA4 as well?
Event tracking from the get-go!
- Right out of the box, Universal Analytics only allows for tracking page-views. While this is already great information to build upon, it's not necessarily enough for a store in the modern age. With GA4, there is more information available without needing to delve deeper into its settings.
- Enhanced Measurement collects important data such as scrolling, clicks, downloads, engagements with videos on your website and more. While this is definitely possible with Universal Analytics as well, GA4 does this without the need for intervention!
- Most websites have a conversion rate of around 2% on the first visit. Retargeting exists for the remainder 98% of users and can spell the difference between a user never visiting your website again and securing a conversion. In most cases, however, once a conversion is secured, you may not want to immediately keep targeting the user with ads. Prior to GA4, retargeting, while still extremely efficient, lacked the dynamism of being able to exclude certain users (either temporarily or permanently) from being retargeted. GA4 changes this and allows you to more efficiently use retargeting to, for example, temporarily exclude users that have recently purchased an item from being shown a particular ad again until they're eligible for a new set.
Redfining time-based events.
- Universal Analytics provides great insight into time spent on pages and sessions, however, the insight can be lacking out of the box when it comes to more specific actions users take on your website, such as watching your neat presentation video. GA4 takes this one step further and allows you to set up time measurements for defined actions or sets of actions through its "Elapsed Time" functionality. This way, you can determine how long it takes a user to watch your video, browse the Category Page and finally complete the Checkout Process.
Bringing Web and Mobile together!
- With the advanced capabilities of Google Analytics 4's Data Streams functionality, you can now centralize all your channels under one property, by setting up Data Streams for each one. This means that, if you have a website and mobile app, for example, you have access to the insights from both under the same Google Analytics property, which will allow you to better piece together and analyze a user's journey across your store, whichever device they choose to use in order to make it.
1 MINUTE INSTALLATION GUI.
Before installing please check the extension compatibility. This extension is currently compatible with the following Magento versions 2.3.X. - 2.4.X. It is recommended to install the extension first on a testing server before you install it on a live (production) server.
Copy the extension files to below paths of your magento 2 instance. If the ‘app/code/WeltPixel’ folder is missing, please create it manually:
Copy the installation GUI folder 'weltpixel-extension-installation' in the root of your Magento installation. In some Magento configurations the public root folder may be under 'pub' directory.
In your browser go to www.yourmagentostore.com/weltpixel-extension-installation/ and simply follow the installation steps from the graphical interface, presented in your browser. See the installation video: 1 Minute Module Installation via browser GUI.
Wooohooo! The extension is now installed on your Magento store! Congrats!
Copy the extension files into the below path of your Magento 2 instance. If the ‘app/code/WeSupply’ folder is missing, please create it manually:
If you experienced any issues or limitations with this quick GUI installation, see also SSH Installation below. SSH installation does the same thing but you are required to issue the commands step by step via CLI. Some servers may have high security configurations and may limit the functionality of this GUI Installer.
How to Install via SSH.
Before installing Google Analytics Enhanced Ecommerce Extension on a Magento 2 store please check the extension compatibility. This extension is currently compatible with the following Magento versions 2.3.X. - 2.4.X. It is recommended to install the extension first on a testing server before you install it on a live (production) server.
Copy the extension files to below paths of your magento 2 instance. If ‘app/code/WeltPixel’ folder is missing, please create it manually:
Access the root of your magento 2 project from command line and run the following commands:
php bin/magento module:enable WeltPixel_Backend --clear-static-content
php bin/magento module:enable WeltPixel_GA4 --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
Flush any cache that you might still have enabled on your server or in Magento.
Woohoo, the extension is installed!
Copy the extension files into the below path of your Magento 2 instance. If the ‘app/code/WeSupply’ folder is missing, please create it manually:
How to Upgrade the extension.
- Step 1. Go to your Google Tag Manager account and remove all tags associated with this extension as new release may contain new tags or adjustments to existing tags. If not removed, tags will not be updated.
- Step 2. Remove extension code under app/code/WeltPixel/GA4 before adding the new extension files. Extension may be refactored and old unused files may cause random issues so it's best to only keep the latest version of the files.
- Step 3. Follow normal installation instructions above.
Magento Marketplace Installation.
- If the extension was purchased from the Magento Marketplace, follow the instructions in this article: How to install extension if purchased from the Magento Marketplace
- If asked for a license, follow the steps presented in section 7 of this article: License key for local / staging / development environment. Multi-store licensing.
HOW TO CONFIGURE GOOGLE ANALYTICS 4 (GA4) WITH GTM SUPPORT.
- a. Go to Admin > Store > Configuration > Sales > Google API > Google Analytics > and set this option to [ No ].
- b. Go to Admin > Store > Configuration > Sales > Google API > Google Adwords > and set this option to [ No ].
- c. Go to WeltPixel > Google Analytics 4 Ecommerce > General Configuration > Enable GA4 and set this option to [ Yes ].
- You need to create a Google Tag Manager account if you don’t have one already at this link: Google Tag Manager
- Set up the Account name and the container in your Google Tag Manager account like in the image.
Step 3. HOW TO SET UP GOOGLE ANALYTICS 4 IN MAGENTO 2.
Once the account is created get the Google Tag Manager (GTM) scripts in admin section of your Magento 2 store WeltPixel > Google Analytics 4 Ecommerce > General Configuration.
You need also to get the code for the "<body>" section.
- Then go to WeltPixel > Google Analytics 4 Ecommerce > General Configuration > Google Tag Manager Non-Js Code and paste the code for "<body>" section in your magento store.
Step 4. HOW TO ADD GOOGLE TAG MANAGER AND GOOGLE ANALYTICS 4 TO MAGENTO 2.
- In Magento admin configure your Google Tag Manager (GTM) API Credentials in order to link your store with your GTM account and generate the default Tags, Triggers and Variables.
For this you need to go to WeltPixel > Google Analytics 4 Ecommerce > GTM API Configuration and fill in the Account ID, Container ID and Measurenent ID fields. All this information can be found in your Google Tag Manager and Google Analytics accounts.
- a) Go to Google Tag Manager (GTM) Identify the IDs in your GTM account like in the picture.
b) Go to Google Analytics (GA) You can see how to get your Measurement ID from your Google Analytics account.
The Measurement ID is available under GA account > Admin > Data Streams > *Select your Stream* > Measurement ID as you can see in the picture.
- Head back into your Magento Admin section and paste the Account ID, Container ID and Measurement ID into the GTM API Configuration section.
- Save the configuration.
The Tag, Trigger and variable generation works via a JSON generation process. The JSON is generated in Magento based on your settings, after which it's imported into Google Tag Manager.
Note: After making any extension configuration changes, remember to re-generate the JSON and re-import and overwrite the existing GTM container to ensure your settings are picked up by Google.
Go to WeltPixel > Google Analytics 4 Ecommerce > JSON Export Options , fill in your Public ID (it can be found in your GTM account) and hit the Generate Json for Variables, Triggers and Tags button.
You will be notified that the JSON has been generated successfully and a Download JSON button will appear. Click the button to download the generated JSON.
Tag Manager Admin.
Go to your Google Tag Manager Dashboard and access the Admin section and choose Import Container
Click on the Choose container file button and find your previously generated and downloaded JSON file. Then, choose a workspace (you can choose an existing workspace or create a new one) and an import option.
When importing your container, you will have the option to merge the imported content with the selected workspace, or overwrite the workspace entirely. Overwriting the selected workspace will remove all your existing tags, triggers and variables in that workspace, and will replace them with the imported container.
Preview and Confirm.
After importing the generated JSON, a preview will show up letting you know the number of changes made to the container. There should be Tags, Triggers and Variables created or updated in various amounts depending on your Magento Admin settings. Click on Confirm and you should be done with importing your settings!
- After all your tags have been created in Google Tag Manager (GTM), go to Google Tag Manager (GTM) account and PUBLISH / SUBMIT all your tags by following the steps from Google Tag Manager.
- ! NOTE: If the container is not published/submitted in your GTM account, no tracking will be available. Make sure to publish your container.
- !! NOTE 2: Displaying statistics in your Google Analytics account based on tracked data could take from 30 minutes from 48 hours according to GTM Documentation. However, real time data should be visible right away if your account is correctly set up.
Woohoo, the extension is configured!Note: Your GA and GTM account are now configured with our pre-generated settings and ready to receive valuable information from your Magento 2 store! You can now gather valuable data and take data driven decisions! Congrats!
Note 2: If you would like to receive even more personalized tracking data, you can always extend your GTM and GA default configurations from your account. If you would like our Google Certified Specialists to help you with that please contact our support for a quote.
- Impression Chunks Size - allows you to break up the payload into smaller chunks. We recommend limiting it to 15. The analytics.js library refuses to send a hit if the full payload size is larger than 8192 bytes. This does require quite a lot of data to be stuffed within, but it only takes some dozens of product impressions to clog up the channel
- Product identifier [ SKU / ID ] - you can identify products in GA and GTM either by SKU or by product ID from your Magento catalog
- Enable Brand - if you would like to have each product brand tracked in Google Analytics Ecommerce Reports - select yes and use appropriate brand attribute
- Order Success Page Total Calculation [ Subtotal / Grandtotal ] - Calculates total amount on success page based on Subtotal or Grandtotal
- Measure Product Clicks - This option allows ‘Product Click’ tracking on Category Page , Search results page and Related/Cross-sell/Up-sell product grids. If Product Click Tracking is enabled this option rewrites Magento_Catalog::product/list.phtml and Magento_Catalog::product/list/list.phtml. If you are using a custom theme/extension already re-writing this templates check here how you can make the necessary compatibility adjustments: How to solve GTM compatibility issues
Promotion Tracking [ Yes / No ] - Example of usage:
<a href="#" data-track-promo-id="PROMOID" data-track-promo-name="PROMONAME" data-track-promo-creative="PROMOCREATIVE" data-track-promo-position="PROMOPOSITION">Content </a>
- Exclude Tax From Transaction [ Yes / No ] - Exclude taxes amount from transaction
- Exclude Shipping From Transaction [ Yes / No ] - Exclude shipping amount from transaction
- Exclude Orders with 0 Value [ Yes / No ] - Orders with value 0.00 can be excluded from purchase transactions if you set this option to Yes
- Success Page Paths - If you are using a custom checkout, and the success page path is different from the default Magento path: 'checkout/onepage/success', you can list it here to make sure the Transaction data is sent to GTM.
- Custom Dimension - Customer ID [ Yes / No ] - Use customer ID as a custom dimension
- Custom Dimension - Customer Group [ Yes / No ] - Use customer group as a custom dimension
- Custom Dimension - Stock Status (insctock/out of stock) [ Yes / No ] - Use customer dimension as a custom dimension
GTM API Configuration.
- Account ID - Must be set as seen in Step 4 from Configure section
- Container ID - Must be set as seen in Step 4 from Configure section
- Measurement ID - Must be set as seen in Step 4 from Configure section
- I.P Anonymization [ Yes / No ] - Allows website owners to request that all of their users' IP addresses are anonymized. It help website owners comply with their own privacy policies or, in some countries, recommendations from local data protection authorities, which may prevent the storage of full IP address information.
Google Adwords conversion tracking.
- Enable [ Yes / No ] - Enables Google AdWords conversion tracking
- Google Conversion ID - You need a Google AdWords account adwords.google.com. Follow Google documentation on how to find Google Conversion ID for AdWords.
- Google Conversion Label - Follow Google documentation on how to find Google Conversion Label for AdWords.
- Google Conversion Currency Code - Fill in currency used in AdWords account. e.g. usd
Google AdWords Remarketing.
- Enable [ Yes / No ] - Enables Google AdWords remarketing.
- Google Conversion Code - Follow Google documentation on how to find Google Conversion Code for Google AdWords Remarketing.
- Google Conversion Label - Follow Google documentation on how to find Google Conversion Label for Google AdWords Remarketing.
Preview and debug GTM tags
Use GTM Preview functionality
There are many ways to troubleshoot your GTM setup. However we found that using the GTM preview mode you can quickly and easily troubleshoot your GTM setup regardless of your expertise level. Go to your GTM account and in the top right corner you will see the Preview Button
- After hitting the Preview Mode button, you will be redirected to the Tag Assistant page where you'll need to input your website's URL.
- You will then be redirected to your website in a new tab, with a confirmation that the debugger is connected. Switch back to the Tag Assistant tab and you'll be able to view every tag that gets fired here.
|Compatibility||Magento Open Source, Magento Commerce, Magento Commerce Cloud B2B|
|Magento version||2.3.x, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5|
|Updates cost||Free lifetime updates|
|Update frequency||Monthly or each time a new Magento version is released|
|Support period||1 Month Free Support, with options to extend|
|Refund period||30 days, for any reason|
|Updated||November 23, 2022|
|Code||100% Open Source Code|
|Bundle options||For best value buy it as part of the Pearl Theme or Stack Framework|
Google Analytics 4 Change Log.
What’s new in v.1.11.14 - Jan 10, 2023
- New Feature: Added full compatibility for Google Analytics 4 PRO with the Hyvä Theme. This is achieved through a compatibility addon provided with the extension. For more details, check out the User Guide.
- Fixed a bug that would sometimes result in users being redirected to a 404 page when adding a product with Configurable Options to their cart from Cross-Sell carousels.
- Refactored event dataLayer push for increased adherence to Google Analytics 4 guidelines.
What’s new in v.1.11.11 - Nov 11, 2022
- New Feature: Extended the Measurement Protocol functionality - It's now possible to send the view_item_list (Impression) event Server-Side. This applies to Category Pages, Search Results Pages, Advanced Search and Upsell/Related Products on Product Pages (PRO version only)
- New Feature: Extended the Measurement Protocol functionality - It's now possible to send the select_item (Product Click) event Server-Side (PRO version only)
- New Feature: Added an Admin option that allows you to choose whether to send the User ID when using Measurement Protocol (PRO version only)
- Fixed an issue whereby the Magento Admin JSON generation process would not generate tags for certain events.
What’s new in v.1.11.9 - October 7, 2022
- New Feature: Added the possibility of disabling the dataLayer for events sent via Measurement Protocol, which ensures none of the selected events are duplicated - PRO version only
- Fixed an issue that certain dataLayer variables to be marked as "Other" when using Magento's Move JS to Bottom functionality in conjunction with Full Page Caching.
- Added various adjustments to Magento Admin setting text for increased clarity.
What’s new in v.1.11.7 - September 1, 2022
- New Feature: Extended the Child/Parent SKU/ID functionality to apply to Add to Cart and Remove from Cart events as well.
- Fixed an error related to PHP 8.1 that was thrown when the Google Ads Remarketing functionality was enabled.
- Fixed an issue that would sometimes prevent Product Impressions from being pushed when using Ajax Pagination.
- Fixed an error related to PHP 8.1 that occurred when refreshing the Success Page.
- Performed various code cleanups related to PHP 8.1.
- Confirmed compatibility with the latest Magento 2.4.5 and 2.4.4-p1 versions.
- Updated installation/upgrade scripts to use data patches.
What’s new in v.1.11.5 - August 17, 2022
- New Feature: The Google Analytics 4 PRO extension is now available for purchase, which contains improved and 100% accurate tracking via Measurement Protocol.
What’s new in v.1.11.1 - April 25, 2022
- New feature: Added the possibility of including custom Success Page URLs with an asterisk to account for dynamic Success Page URLs and increase compatibility with 3rd party Payment Methods.
- Fixed a bug that, in some cases, caused the default Magento pagination to break on Category Pages when the module was enabled.
- Fixed an error that occurred when the Impression Chunk Size setting in the Magento Admin was set to 0.
- Ensured Price and Quantity values are passed as integers via the dataLayer to conform to Google recommendations.
- Initiated a clear of the dataLayer eCommerce object before a push event to conform with Google recommendations.
- Added a "value" parameter to the dataLayer for Checkout and View Cart events.
- Code cleanup: Removed certain unused jQuery/UI elements from the Magento Admin.
- Fixed an incorrect licensing message on B2B Magento Enterprise instances which would display when an invalid license was entered.
- Confirmed compatibility with the latest Magento 2.4.4 and 2.3.7-p3 versions as well as PHP 8.1.
What’s new in v.1.10.17 - October 22, 2021
- Confirmed compatibility with the latest Magento 2.4.3-p1 and 2.3.7-p2 versions.
What’s new in v.1.10.17 - October 22, 2021
- Confirmed compatibility with the latest Magento 2.4.3-p1 and 2.3.7-p2 versions.
What’s new in v.1.10.15 - August 31, 2021
- Fixed an error that was thrown when disabling the Google Tag Manager or Google Analytics 4 extensions before installing other WeltPixel extensions - This issue affected Pearl Theme users only.
- Added performance optimizations and enhanced compatibility with 3rd party code on Category Pages.
- Confirmed compatibility with the newly released Magento 2.4.3, 2.4.2-p2 and 2.3.7-p1 versions.
- Added .localhost as an accepted domain termination for the licensing process.
Version 1.10.11 - July 7, 2021
- Fixed an incompatibility with the default Magento 2.4.2 Move JS to Bottom functionality. When enabled, it would change the execution order of events on the Success Page, which sometimes caused missing transactions in Google Analytics.
- Fixed an issue that caused missing Revenue in Google Analytics 4. Requires a regeneration and reimport of the JSON file into Google Tag Mangager, after which the container needs to be published.
- Added improvments to the WeltPixel Developer Magento Admin section. Latest Cron Jobs now lists the last 100 executed Cron Jobs.
Version 1.10.9 - May 18, 2021
- Fixed a Display Currency discrepancy related to the Add and Remove from Cart events.
- Confirmed compatibility with the newly released Magento 2.3.7 and 2.4.2-p1 versions.
Version 1.10.7 - March 26, 2021
- Added compatibility adjustments with a new Product Labels extension functionality. Requires the WeltPixel Product Labels extension.
- Added small Magento Admin label adjustments.
- Adjusted WeltPixel Developer section comments.
Version 1.10.5 - February 4, 2021
- Initial release.