Why Your Purchase Event Might Not Be Firing in GTM4WP
Content
One of the most common issues reported by users of the 'GTM4WP – A Google Tag Manager (GTM) plugin for WordPress' is the purchase event failing to fire. This critical ecommerce event is essential for tracking revenue and conversions in tools like Google Analytics and Facebook Pixel. Let's explore the typical reasons this happens and how to resolve them.
The Problem: Missing Purchase Data
When the purchase event doesn't fire, you'll notice missing transaction data in your analytics dashboards. The order confirmation (thank you) page loads, but the crucial gtm4wp.orderCompleted or purchase event is absent from the dataLayer.
Why This Happens
Based on community reports, the issue is rarely a bug in the plugin itself. Instead, it's almost always caused by a conflict between the plugin's expected environment and a site's specific configuration.
Common Causes and Solutions
1. Custom Thank You Page URL
The Issue: The plugin is designed to push the purchase event to the dataLayer on the default WooCommerce order-received endpoint (/checkout/order-received/). If you are using a custom thank you page with a different URL structure (e.g., /dankeseite/ or /afronden/bestelling-ontvangen), the plugin may not recognize it as the order confirmation page.
The Solution: Ensure your custom thank you page mimics all the features of the default WooCommerce order received page. Most importantly, the order ID must be present in the URL. The plugin relies on this to trigger the event. If you are using a page builder or a custom template, you may need to manually ensure the necessary GTM4WP code is output on that page.
2. 8kB dataLayer Size Limit
The Issue: The data pushed on the gtm4wp.orderCompleted event can be very large, sometimes containing duplicate product and customer data. If the total payload exceeds roughly 8kB, the entire event can be dropped, preventing it from being processed by Tag Manager.
The Solution: To reduce the payload size, navigate to the plugin's settings (GTM4WP > Integration > WooCommerce) and review which data layers you have enabled. Only check the options that are absolutely necessary for your tracking. Unchecking superfluous options can significantly reduce the dataLayer size and prevent this cutoff issue.
3. Third-Party Plugin and Theme Conflicts
The Issue: Other plugins or your theme can interfere with the standard WooCommerce hooks that GTM4WP uses to trigger the purchase event.
The Solution: Perform basic conflict troubleshooting. Disable other plugins one by one (on a staging site) and switch to a default WordPress theme like Twenty Twenty-One to see if the purchase event begins firing. This will help you identify the conflicting software.
4. Incorrect GTM Trigger
The Issue: Even if the dataLayer event is firing correctly, your Google Tag Manager setup might be misconfigured and not listening for it.
The Solution: In Google Tag Manager, create a Custom Event trigger with the following settings:
- Trigger Name: Custom Event - Purchase
- Trigger Type: Custom Event
- Event Name:
gtm4wp.orderCompleted
purchase), so you may need to create a separate trigger for that.
Need More Help?
If you've worked through these steps and are still experiencing issues, the best course of action is to provide a detailed report on the plugin's official support forums. Be sure to include your site's URL and describe any customizations you've made to your checkout and thank you pages. The more information you can provide, the easier it will be for the community to help diagnose the problem.
Related Support Threads Support
-
Sessions with Product Views empty in Shopping Behaviour Analysishttps://wordpress.org/support/topic/sessions-with-product-views-empty-in-shopping-behaviour-analysis-3/
-
view_search_results eventhttps://wordpress.org/support/topic/view_search_results-event/
-
Google Analytics not registering Add To Carthttps://wordpress.org/support/topic/google-analytics-not-registering-add-to-cart/
-
gtm4wp_productdata missing on the WC archive pagehttps://wordpress.org/support/topic/gtm4wp_productdata-missing-on-the-wc-archive-page/
-
Reload site? Changes you made may not be saved.https://wordpress.org/support/topic/reload-site-changes-you-made-may-not-be-saved/
-
add_payment_info only triggered in first selectionhttps://wordpress.org/support/topic/add_payment_info-only-triggered-in-first-selection/
-
view_item remarketinghttps://wordpress.org/support/topic/view_item-remarketing/
-
Refundshttps://wordpress.org/support/topic/refunds-14/
-
Triggering shipping and payment info after place order on GA4https://wordpress.org/support/topic/triggering-shipping-and-payment-info-after-place-order-on-ga4/
-
Headless implementationhttps://wordpress.org/support/topic/headless-implementation/
-
Order completed event problemhttps://wordpress.org/support/topic/order-completed-event-problem-2/
-
Duplicate view item events in GTMhttps://wordpress.org/support/topic/duplicate-view-item-events-in-gtm/
-
set value to zero for certain product IDshttps://wordpress.org/support/topic/set-value-to-zero-for-certain-product-ids/
-
Track if user has added payment detailshttps://wordpress.org/support/topic/track-if-user-has-added-payment-details/
-
No data arrives GA anymorehttps://wordpress.org/support/topic/no-data-arrives-ga-anymore/
-
How is the event name being transmittedhttps://wordpress.org/support/topic/how-is-the-event-name-being-transmitted/
-
Triggers not shown in GAhttps://wordpress.org/support/topic/triggers-not-shown-in-ga/
-
GA4 EEC Templatehttps://wordpress.org/support/topic/ga4-eec-template/
-
Greater ‘checkoutStepEEC’ Events/Sessions than ‘addProductToCartEEC’https://wordpress.org/support/topic/greater-checkoutstepeec-events-sessions-than-addproducttocarteec/
-
Google Analytics not registering Add To Cart anymorehttps://wordpress.org/support/topic/google-analytics-not-registering-add-to-cart-anymore-2/
-
Plugin not recognising second checkout stephttps://wordpress.org/support/topic/plugin-not-recognising-second-checkout-step/
-
Reducing size of data layer on orderCompletehttps://wordpress.org/support/topic/reducing-size-of-data-layer-on-ordercomplete/
-
Facebook Pixel, “PageView Event Violates Business Tools Terms”https://wordpress.org/support/topic/facebook-pixel-pageview-event-violates-business-tools-terms/
-
Purchase event Google Support-Anfragehttps://wordpress.org/support/topic/purchase-event-google-support-anfrage/
-
Wheater data – where to find ithttps://wordpress.org/support/topic/wheater-data-where-to-find-it/
-
Add to cart on cart or checkout pagehttps://wordpress.org/support/topic/add-to-cart-on-cart-or-checkout-page/
-
Purchase event not firinghttps://wordpress.org/support/topic/purchase-event-not-firing-10/
-
Exclude User roleshttps://wordpress.org/support/topic/exclude-user-roles-4/
-
Memberpress Enhanced Ecommerce trackinghttps://wordpress.org/support/topic/memberpress-enhanced-ecommerce-tracking/
-
GA4 version of the ecommerce datahttps://wordpress.org/support/topic/ga4-version-of-the-ecommerce-data/
-
Facebook Pixel Implementation for Purchase Events with Custom Variablehttps://wordpress.org/support/topic/facebook-pixel-implementation-for-purchase-events-with-custom-variable/
-
Missing checkout stephttps://wordpress.org/support/topic/missing-checkout-step/
-
Product Page Bounce Rate 0%https://wordpress.org/support/topic/product-page-bounce-rate-0/