
Magento 2 Google Tag Manager Extension (GTM) - Enhanced Ecommerce extension - Universal Analytics Tracking.
Following the sunsetting of Google Analytics Universal Analytics, this extension has been deprecated. To gain access to eCommerce tracking & insights for your Magento 2 store, get the Google Analytics 4 extension.
The ability to measure data efficiently is crucial in this day and age. With the WeltPixel Google Tag Manager 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
Free Version
Pro Version
For Best Performance and Optimization use this Extension with:
We packed it all up to offer the smoother UX for your customers and made sure that all extensions work smoothly together.
About Google Analytics For Magento 2.
Google Analytics Enhanced Ecommerce for Magento 2 allows you to get full Enhanced Ecommerce tracking implemented within minutes so you can start gathering valuable data and take data driven decisions.
Easy Installation and Configuration: predefined Variables, Triggers and Tags can be automatically created in your Google Anaytics and Google Tag Manager accounts with one click API sync between your Magento 2 store and your GA and GTM accounts.
Google Analytics Enhanced Ecommerce is implemented using Google Tag Manager and allows you to track Product Impressions, Product Clicks, Product Detail Impressions, Add/Remove product to cart, Promotion Impressions, Promotion Clicks as well as Measure each step in the checkout process.
With Google Analytics Enhanced Ecommerce, marketers will be able to add, edit or remove marketing and measurement tags without the intervention of webmasters. Google Analytics Enhanced Ecommerce is a free tag management tool where you can deploy and manage various tags and code snippets on a Magento 2 store, such as those intended for traffic analysis and marketing optimization.
At a high level, Google Analytics Enhanced Ecommerce works like this: A small snippet of code is placed on your Magento 2 store, that is connected to the Tag Manager servers. A web based interface is used to install tracking codes on your store automatically. The benefits of this extension is that you usually will have to write no additional code to deploy or modify tracking codes for your marketing or analytics campaigns.
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
- 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 (PRO)
- Track product review count (PRO)
- Track product review score (PRO)
- Track stock status (PRO)
- Track Sale products (PRO)
- Track transactions by product variants (configurable product) (PRO)
- Track transactions by product custom options (PRO)
- Track custom dimension Page Type (PRO)
- Track custom dimension Page Name (PRO)
- Product level Custom Dimension / Metric sending (Send up to 5 product attributes to GTM) (PRO)
Made for Web Merchandisers.
"Enhanced Ecommerce gives me information beyond shopper behavior, I actually know what products my customers need!"

Web Merchandisers question:
"How visitors are navigating through my web store, which categories are the most visited, which products are the most often clicked through from a certain category based on their position?"The Solution:
Our extension allows you to have visibility over merchandise by category, position, products and SKU. You can also extend each report to understand which products from a certain category gets the most views and has the best click through rate based on position in the listings.
Enhanced Ecommerce will also track how many times a product was added to the cart, removed from it or was succesfully purchased. Have full visibility of your customers interaction with your website.
Web Merchandisers question:
"I want to increase Average Order Value, what products are converting as Related, Upsell and Cross-sell? Am I recommending the right products?"The Solution:
Get a real understanding of how much revenue related, upsell and cross-sell products generated? You can now easily track the Impressions, Click Through Rate, how many times an item was added to the cart and Sales generate. Understand what is working and what doesn’t so you can take quick actions to improve your average order value!


Web Merchandisers question:
"How visitors are navigating through my web store, which categories are the most visited, which products are the most often clicked through from a certain category based on their position?"The Solution:
Our extension allows you to have visibility over merchandise by category, position, products and SKU. You can also extend each report to understand which products from a certain category gets the most views and has the best click through rate based on position in the listings.
Made for Ecommerce Manager.
"All of my data is in one place, and I can see the details behind the big picture so I can optimize marketing programs, and increase sales.""
Ecommerce Manager question:
"I don’t have many reviews on my website, should I focus on getting more reviews or really good reviews? How many reviews/product and what review score starts improving conversion rate? "The Solution:
Custom Dimensions for Product Reviews will allow you to track and understand how product reviews are influencing conversion rate. You will be able to attach a monetary value to every review that you get and be able to understand which review score is positively/negatively influences conversion rate.


Ecommerce Manager question:
"I have many coupon codes and they are posted all over the Internet! How can I understand which coupon from which marketing channel performed the best?"The Solution:
Enhanced Ecommerce can track coupon code performance by traffic source and medium. This will allow you to quickly understand how much revenue each coupon code generated, what coupons are working on some marketing channels what doesn’t. This way you can optimize your marketing efforts and really understand what kind of promotions are working and where.
Ecommerce Manager question:
"I am wondering if my website is intuitive enough, is my checkout process easy to follow? Are my customers getting stuck in the purchase funnel?"The Solution:
The Shopping behavior report will let you analyze your users shopping experience form product impressions to transactions. You will better understand which part of your website is not optimized enough and results in abandonment.
The Checkout Behavior Analysis report lets you see how successfully your users moved through your checkout process. The checkout-funnel visualization illustrates how many users moved on from one step to the next, how many abandoned the process at each step, and how many entered the process at each step.


Ecommerce Manager question:
"All the sudden I started selling a product that never got sold before! How can I find out which marketing channel helped me sell this product?"The Solution:
With Enhanced Ecommerce you can now track which traffic source and marketing initiative generated the sale of an exact product! Stop wondering and start optimizing your marketing efforts to start selling products that you had a hard time to sell before!
Ecommerce Manager question:
"My homepage has multiple banners in the slider, are people actually seeing my 4th slide? Are they clicking through?"The Solution:
Enhanced Ecommerce has the ability of tracking both impressions as well as click of a specific promotional banner on your website. More then that, it can exactly track how many transactions it generated and what was the total revenue generated by a banner by position. This report will allow you to better optimize the position and the messaging of each of your banners.


Ecommerce Manager question:
"How can spending on traditional marketing channels, such as search engines, comparison engines, emails and affiliates be tied to ROI or optimize?"The Solution:
See all of your marketing data in one place, with attribution by source so you manage marketing ROI.
How to Configure Google Analytics in Magento?
Step 1.
- Go to Admin > Store > Configuration > Sales > Google API > Google Analytics > and set this option to [ No ].
- Go to Admin > Store > Configuration > Sales > Google API > Google Adwords > and set this option to [ No ].
- Go to WeltPixel > Google Analytics Enhanced Ecommerce > General Configuration > Enable Google Tag Manager and set this option to [ Yes ].


Step 2.
- You need to create a Google Tag Manager account if you don’t have one already at this link: https://www.google.com/analytics/tag-manager/
- Setup Account name, Setup Container from yout Google Tag Manager like in the image.
How to Setup Google Universal Analytics in Magento?
-
Once the account is created get the Google Tag Manager (GTM) scripts in admin section of your Magento 2 store WeltPixel > Google Analytics Enhanced Ecommerce > General Configuration.
You need also to get the code for the "<body>" section.


- Go to WeltPixel > Google Analytics Enhanced Ecommerce > General Configuration > Google Tag Manager Javascript Code and paste the code for "<head>" section in your magento store.
- Then go to WeltPixel > Google Analytics Enhanced Ecommerce > General Configuration > Google Tag Manager Non-Js Code and paste the code for "<body>" section in your magento store.


How to Add Google Tag Manager GTM to Magento?
- In Magento admin configure your Google Tag Manager (GTM) API Credentials in order to automatically link your store with your GTM account and create all default provided triggers automatically with one click.
-
For this you need to go to WeltPixel > Google Analytics Enhanced Ecommerce > GTM API Configuration and fill in Account ID, Container ID, Universal Analytics Tracking ID. All this information can be found in your
Get information from Google Tag Manager and Google Analytics accounts.
- Go to Google Tag Manager (GTM) Identify the IDs in your GTM account like in the picture.
Step 4B. GETTING YOUR UNIVERSAL ANALYTICS ID.
- Hit Admin (the settings cog in the bottom left corner) and then Create New Property. You'll then be taken to the account creation screen.
- Select an Account Name, choose the sharing settings and proceed to the next step.
If you don't already have a Google Analytics Property, head to the Google Analytics website and create one.


- Important Note: After choosing your Property Name, you'll need to hit the Show Advanced Options button in order to be able to create a Universal Analytics Property, which is what the extension functions with.
- Turn on the Create a Universal Analytics Property toggle and input your website's URL.
- select Create a Universal Analytics Property only and hit Next.
-
You'll automatically be taken to a section of the Property in which you can see your Universal Analytics Tracking Code.
The Tracking Code is also available under Admin > Property settings > Tracking ID as you can see in the picture.
Note: Once you fill in the above ID’s save the GA settings in order not to lose the credentials on page refresh.


Step 5.
- After filling Accout ID, Container ID and Universal Analytics Tracking ID, hit Sign in to Google and allow to link your Google Tag Manager (GTM) account with your Magento Store
You will be notified to save your credentials in order not to lose them before continuing with the process.
Hit Save Config button.
Note!: If, for any reason, the Sign in to Google functionality does not work for you, try out the JSON Export process as an alternative. You can find it by scrolling down to the last section of the extension options in the Magento Admin.
Step 6A.
-
Go to WeltPixel > Google Analytics Enhanced Ecommerce > GTM API Configuration and hit Create Variables, Triggers and Tags button.
You will be notified about the Variables, Triggers and Tags created.


Step 6B.
As an alternative, if the Sign in to Google functionality does not work, you can export the configuration as a JSON and import it into your Google Tag Manager container.
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.
Generate JSON.
-
Go to WeltPixel > Google Analytics Enhanced Ecommerce > JSON Export Options 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 yourGoogle Tag Manager Dashboard and access the Admin section and choose Import Container


Import JSON.
-
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!


Step 7.
- 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 shoud be visible right away if your account is correctly setup.
Step 8.
-
In your Google Analytics account, go to Admin > Ecommerce Settings in order to define the labels for checkout-funnel steps.


Checkout Steps E-Commerce setup.
How to integrate Google Analytics with Magento 2
In order to activate your conversion sections of your Google Analytics dashboard you have to:
-
a. Enable Ecommerce
-
b. Enable Enhanced Ecommerce Reporting
-
c. Add Checkout Labeling (Funnel Steps). Each store can have different checkout steps, so make sure to identify your checkout steps using GTM debugger (GTM container preview) before adding them here in order to avoid wrong tracking. Here is a common Magento checkout funnel example:
- Shipping
- Shipping Method
- Payment and Billing
-
d. Save Ecommerce set-up.
More details about Checkout funnels here: How to setup Enhanced Ecommerce reports (Google Documentation)
How to Identify How Many Steps My Magento Store Has?
- Go to your GTM dashboard and enable preview mode


- Go to your store and with the preview mode enabled proceed to checkout. (Make sure you have at least one product in the shopping cart!)
- If the GTM container is in preview mode, you should already see the GTM tag debugger when loading your checkout page. (Make sure you are using the same browser for enabling preview mode and the debugging of your checkout steps.)
- You will find that under Checkout - Data layer, each step that has loaded can be seen as in our example.
- Step 1 (Shipping Address).
Great news! We've identified the first step (Shipping Address) of the checkout process presented in this example! We'll need to remember it, as in the sections below, we'll be shown how to add this step to the Google Analytics checkout funnel.
Note: Each checkout process is different, so for your store, you may have a different option here.
- Next, we'll need to head to the following step of the checkout process, which, in our case is the Shipping Methods section, make sure you select an option and click the Next button.


- In the preview window you will see two new events fired, a new checkout event for step 2 as well as the option associated with this step.
- As you can see in the photo on the left, we've identified -> Step 2 (Shipping Methods) of our example. Just make a note of it, as it will have to be added to the Google Analytics checkout funnel as well.
Note: Each checkout process is different, so for your store, you may have a different option here.
- Since Step 2 has multiple shipping methods, in our example, in the Checkout Option section of the GTM debugger, you can find out more specific details about the selected shipping option.
Note: This is informative, and you'd only need to access this if you wanted additional details about this checkout step.


- In our checkout funnel the next step is to select Payment Method. We select the payment method and click on the Place Order button.
- By pushing the Place Order button we are redirected to the checkout success page and we've successfully identified this step as well as being Step 3 (Payment Method) by following the same process explained in the sections above.
How to Configure Google Analytics Checkout Behavior for Magento?
Step 11.
- Go to Admin -> Ecommerce Settings, as shown in the photo on the right.
- Each checkout table has a number on the left hand side, that number needs to match with the checkout step identified above. Under Label Name, simply type in the name of each step of your own checkout process identified in the previous section. It's important that they match exactly, as otherwise, the checkout drop-off behavior that shows in the GA account would not be relevant to your store.
- After a few days of data collection you will be able to visualize the checkout funnel in your report under Conversions -> Ecommerce -> Checkout Behavior. According to Google, it may take up to 48 hours for data to start flowing in.
- Please note that reporting will be only available from the moment your setup the checkout behavior steps. It will not provide data for days prior to setup.

Step 12.
-
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.
How to Configure Google Tag Manager in Magento?
- Google Tag Manager Javascript Code Position [ In the head tag / Before body close tag ] - choose position where Javascript code to be inserted. Default: In the head tag.
- 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
How to Configure the Google Tag Manager API in Magento?
- 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
- Universal Analytics Tracking 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.


How to Track Google AdWords Conversion in Magento?
- 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
How to Enable Google AdWords Remarketing in Magento?
- 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.


How to Link Your Google Analytics Account with AdWords?
- Linking your Google Ads account to your Analytics property lets you see the full customer cycle, from how they interact with your marketing (e.g., seeing ad impressions, clicking ads) to how they finally complete the goals you’ve set for them on your site (e.g., making purchases, consuming content).
- When you link Google Ads and Analytics, you can see ad and site performance data in the Google Ads reports in Analytics.
- When linking GA with AdWords you can select if you want Manual or automatic tagging.
- Please refer to this article for more information https://support.google.com/analytics/answer/1733663?hl=en&utm_id=ad
Step 1.
- Go to GA Admin
Step 2.
- Under the Product Linking column, click on Google Ads Linking.


Step 3.
- Once configured, click on Link accounts.
- Presto! Google Analytics is now linked to AdWords!
How to Setup Custom Dimensions & Metrics in Google Analytics?
Step 1.
- Google Analytics allows for tracking custom Dimensions as well as custom Metrics.
- Our extension enables you to track multiple custom dimensions specific to each custom dimension scope.
- In GA you will need to setup custom dimensions to enable tracking.
- Go to: GA Admin


Step 2.
- Under the Property column, click on Custom Definitions and then Custom Dimensions
Step 3.
If you are just starting out we highly recommend creating everything as described. In Magento Admin Panel we are pre-populating each custom dimension with sample indexes for your help. Please make sure that the Custom Dimension scopes and Indexes in Magento match with the ones created in GA. In a fresh GA account, the index number will start from 1 and as you create them will increase sequentially. An example can be seen in the screenshot in Step 6.
- Click on the +New Custom Dimension button.


Step 4.
- Insert Custom Dimension Name.
- Select the Custom Dimension Scope.
- Make sure the Active box is checked.
- Click on the Create button.
Step 5.
- Click on the Done button to complete the creation of your Custom Dimension.


Step 6. Success!
- This is an example. If you are an advanced GA user, go ahead and set each dimension up as you wish. Just make sure they match with what you have in Magento.
- The index number can be found here (if created for the first time, this will be in a sequential order):
- As soon as the Custom Dimensions are setup in GA and they are verified to match with Magento, hit the Create tags button in your Magento Admin. This will automatically assign each custom dimension to the appropriate tag in GTM.
- If you've already created the tag, the GTM PRO version of our module will automatically update each tag as soon as you sync the Magento tags with GTM.

Troubleshooting.
How to 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
- As soon as you enable the Preview Mode go to your website and refresh the page. You will see all the Tags that got fired.
