Magento 2 Google Tag Manager - Missing transactions/revenue

Loading...
Back to Blog
Magento 2 Google Tag Manager - Missing transactions/revenue

One of the most crucial functionalities an online store can benefit from is good data analytics. This is achieved by proper implementation of Google Analytics tracking, and, more recently, Google Analytics 4. 

For the Magento 2 platform, we've made this process a simple one via our hugely popular Magento 2 Google Tag Manager - Enhanced eCommerce (Universal Analytics) extension, which is used by over 11000 merchants, and, following the public release of the Google Analytics 4 platform, our Magento 2 GA4 (Google Analytics 4) with GTM Support extension.

The extensions are designed to have an easy-to-follow and simple configuration process that can get your store up to speed with important analytics in a matter of minutes. The extensions facilitate the tracking of Product Impressions, Product Adds-to-Cart, Checkout Steps, and, most importantly, Transactions.

While most users of these extensions have successfully managed to install and configure them, there may be some cases in which various data is either missing or incomplete in Google Analytics. In this particular instance, we'll be focusing on missing or incomplete transactions. The scenarios below will address both, so let's see what the causes might be.

 

Scenario 1 - Incomplete/Inaccurate Transactions in Google Analytics

This scenario applies when transactions are being tracked in Google Analytics following the configuration of the extension, however, you've noticed that this does not apply to all transactions.

The most important observation that can be made here is that 100% accurate reporting between the backend, in this case, Magento 2 and Google Analytics should not be expected, no matter what method of tracking is implemented. Realistically, you can expect anywhere from 5% (in a best-case scenario) to 30% (or more) of your orders not to show up in Google Analytics. This is because of the following potential reasons:

 

  • Cookie Policies are not being accepted - This applies if you have a Cookie Policy enabled on your website. Tracking scripts only load into the page if the Cookie Policy is accepted, however, customers can browse your store and even place orders without accepting the Cookie Policy, assuming it's not enforced. This behavior is a default in Magento and ensuring it applies is best practice for any extension or implementation of Google Analytics tracking.
  • Ad-Blockers or other browser extensions that block scripts are being used - Some Ad-Blocker browser extensions have the capability of not only blocking ads but also tracking scripts, thereby not allowing the extension to track any orders they place on the store.
  • Strict browser security settings or the Brave browser is being used - Customers can have specific browser security settings that block tracking scripts. The Brave browser does this by default, so if a customer places an order using this browser, it likely will not be tracked.
  • JavaScript disabled in the browser - Tracking scripts are essentially JavaScript, which means that, if JavaScript is disabled in the browser being used, the tracking scripts will not be initialized. This will ultimately result in orders they placed not being tracked.

 

If you see a part of the orders placed in your Analytics dashboard and the information attributed to them, such as the order total and coupon codes, is correct, this likely means that the tracking itself is functioning correctly and the missing orders are attributed to one of the points listed above.

 

Scenario 2 - Missing Transactions in Google Analytics

This scenario applies when no order data is being recorded in Google Analytics at all. While this issue is not very common, the multitude of different environment configurations and variables can result in this occurring once in a while, so we'll explore a few potential causes, as well as the solutions.

 

1. Incomplete or incorrect configuration of the extension

This is the most important point on the list. The steps for configuring the extension are found in the documentation that came with the module, found in the extension files zip, as well as in the User Guides found on the respective Product Pages. We'll also link these below for convenience:

Failure to configure the extension properly can result in missing transactions, so it's always important to double-check that all the configuration steps were followed correctly and completely.

This is what a correct configuration would look like in the GTM API Configuration section of the Magento Admin:

WeltPixel GTM Admin Configuration

Something similar to this example is what you would expect to see here if all the steps in the configuration process have been followed. These details need to match what you have in your Google Tag Manager container and Google Analytics property. Details on where to find the correct info can be found in the User Guides.

 

2. The latest version of the extension is not being used

This is another extremely important point. We release compatibility updates, as well as bug fixes and optimizations in most new versions of our products. This means being on the latest version is crucial to ensure your instance is running the latest of these fixes and improvements. The steps for updating your module to the latest version can be found in the respective User Guides linked above.

Extension versions can be verified in the Magento Admin under Admin -> WeltPixel -> WeltPixel Debugger -> Extensions Version:

WeltPixel GTM Version

 

3. There are other tracking scripts or extensions present on the website

Inserting other Google Analytics tracking scripts in the header section of your store can cause conflicts with our own scripts and keep them from working correctly. It's strongly recommended that, if you use our extension, there are no other sources of tracking, be they 3rd party extensions or standalone scripts.

An example of where you could find a 3rd party tracking script is as Admin -> Content -> Design -> Configuration -> Store-View -> Edit -> HTML Head -> Scripts and Stylesheets and it would look something like this:

WeltPixel GTM Custom Scripts

Our extension will produce the following results on the frontend when verified with the Google Tag Assistant Chrome Extension:

WeltPixel GTM Tag Analysis

Note: If you've also configured the extension for Google Ads Conversion Tracking and/or Google Ads Remarketing, you'll see tags for those here as well.

 

3. Custom Success Pages/Checkout solutions

Some checkout Success Pages and One Step/Custom Checkout solutions alter the default Magento checkout flow that the extension is built on. If the custom checkout customizes the way API calls are handled, the extensions will need compatibility adjustments with the new checkout flow, which would need to be investigated with a developer. 

To test and confirm, you can disable your Custom Checkout and place a few test orders. If those make it into Google Analytics, the Checkout is causing the issue and would have to be adjusted for compatibility.

A potential solution, if your Custom Checkout modifies the Success Page URL, is to use an option we have in the extension configuration whereby you can define the custom URL, which, in some cases, can help restore transaction tracking. The option is found in Admin -> WeltPixel -> Enhanced eCommerce GTM Settings -> General Configuration -> Success Page Paths:

WeltPixel GTM Checkout URL

Note: If you make any changes here, or anywhere else in the extension configuration options after you've already generated and imported your configuration JSON into Google Tag Manager, you'll need to regenerate and re-import the JSON into Google Tag Manager, after which you'll have to re-publish the container to get the changes to apply.

 

4. Extensions that alter/move JS

If you use optimization extensions that alter/move the JS from the head section to other parts of the store, this can interfere with our own script and cause it to initialize incorrectly. If you're running such extensions, those should be disabled.

The extension is fully compatible with our own Magento 2 Speed Optimization extension, as well as the default Magento Move JS to Bottom functionality, however, we're unable to account for other, 3rd party, or custom functionalities and these can cause conflicts. 

A recent case in which we conducted an investigation involved a 3rd party functionality from a custom theme that was labeled Defer JS. This functionality being enabled made no apparent change to where the script was initialized (usually, scripts are moved from the Head to the Footer section), however, it was changing the order of events on the Checkout Success Page, which caused the purchase data to be sent

after the container initialization, thus resulting in a missed transaction. All other events were captured correctly.

This can be confirmed with Google Tag Manager Preview Mode, and the following example shows what the order of events on the Checkout Success Page is supposed to look like:

WeltPixel GTM Preview Mode Event Order

Purchase data is sent during the Message event, and this needs to happen before the Initialization and Container Loaded events. If the order of elements on your Success Page is different, you have an extension/theme functionality/piece of custom code that is affecting this, which is also likely the reason your transactions are not being recorded. 

If you see this happening via the Preview Mode, disable any 3rd party optimization extensions/functionalities you can find, and if the issue persists, check with your developer to conduct a more thorough investigation.

 

To conclude

Exhausting the troubleshooting in this list should ensure you find the cause of your missing/incomplete transactions and apply the necessary adjustments or take the required actions to resolve the issue you're facing. If you feel, however, that you've discovered a bug whereby the extension doesn't function as expected on a default environment, we're always more than happy to help out and attempt to reproduce the issue based on your report, so just reach out with the details and reproduction steps.

Related Products