Magento 2's Broken GTag Adwords Integration: Why Your Conversions Aren't Tracking

Magento 2's Broken GTag Adwords Integration: Why Your Conversions Aren't Tracking

As e-commerce experts specializing in Magento migrations, we frequently encounter critical issues that impact store performance and profitability. A recent GitHub issue (#40879) has brought to light a significant flaw in Magento 2's core GTag Google Adwords module, revealing that it fails to report conversions correctly, if at all. This isn't just a minor bug; it's a fundamental breakdown in a crucial marketing integration that could be costing merchants valuable insights and ad spend efficiency.

The Core Problem: Missing Conversion Data

The issue, reported for Magento 2.4.8-p4, details how the official GTag module for Google Adwords, intended to track conversions from ad campaigns, is fundamentally broken. The module attempts to fire a conversion event, but critically, it omits essential data required by Google Adwords, such as the transaction value, currency, and transaction ID. Without this data, Google Adwords simply ignores the event, resulting in zero reported conversions.

The reporter, hewgim, meticulously analyzed the module's code, specifically in vendor/magento/module-google-gtag/view/frontend/web/js/google-adwords.js. They found that while a gtag('event', 'conversion', ...) call is present, it only sends the send_to parameter (conversion ID and label). This contrasts sharply with Google's recommended event snippet, which explicitly includes value, currency, and transaction_id.

Magento's Implementation:

gtag('set', 'developer_id.dYjhlMD', true);
if (config.conversionLabel) {
    gtag(
        'event',
        'conversion',
        {'send_to': config.conversionId + '/'
                + config.conversionLabel}
    );
}

Google's Recommended Event Snippet:


Further Flaws and Confusion

Beyond the missing data, the issue highlights several other concerning aspects:

  • Incorrect Event Firing: The Magento code appears to fire the conversion event on every page load if configured, rather than exclusively on the order success page as Google recommends.
  • Developer ID in Production: The presence of gtag('set', 'developer_id.dYjhlMD', true); is noted as potentially problematic, suggesting it should only be active during development.
  • Script Placement Warnings: The author points out that Magento's dynamic insertion of the GTag script into the head section during page load, instead of being present in the page source's , leads to "Tag not placed correctly" warnings from Google's tag diagnostics, potentially impacting performance and data accuracy.
  • Configuration Complexity: The issue also notes the confusing array of Google API options within Magento's configuration, making it difficult for merchants and developers to discern which module (Universal Analytics, old Adwords, GTag Analytics, GTag Adwords) is relevant and functional.

Severity and Workarounds

Initially classified as a "feature request" by an Adobe Commerce engineer, the reporter strongly argued that this is a critical bug (Severity S1). Their reasoning is sound: a module designed for a specific purpose that utterly fails to perform that purpose should not be considered a new feature but a broken core component. The author concludes with a stark warning:

"To anyone reading this. Don't waste your time with the Google API extensions provided by Magento (Open Source). They don't work well, if at all, and you'll need a third-party extension."

This insight underscores the importance of robust analytics for e-commerce success. For Magento Open Source users, relying on the core GTag Adwords module as it stands is a recipe for inaccurate reporting and potentially wasted ad spend. Until this critical flaw is addressed, merchants and developers should prioritize implementing a reliable third-party extension for Google Adwords conversion tracking.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools