Troubleshooting

Purchase/Transaction Tracking Not Working on WordPress

3 min read··By the TrackingCoder team
🔧

Common reasons purchase tracking doesn’t fire

  1. GTM container not published - You imported the container but didn’t click Submit → Publish.
  2. GTM snippet not installed on your site - The GTM code needs to be in your site’s <head> and <body>.
  3. Thank-you page is on a different domain - If your checkout redirects to a third-party payment processor’s confirmation page, GTM isn’t installed there and can’t fire.
  4. Order data is not in the dataLayer - The GA4 purchase event needs transaction_id, value, and items in the dataLayer. If your site doesn’t push this data, the tag fires but sends empty values.
  5. WooCommerce order-received page detection - WooCommerce appends /order-received/ with an order ID to the URL. If your trigger uses an exact URL match instead of “contains”, it won’t fire.
  6. Shopify checkout is on a restricted domain - Shopify’s checkout runs on checkout.shopify.com, where you cannot install custom GTM containers. You must use Shopify’s native conversion tracking or Customer Events for checkout tracking.
  7. WooCommerce order-received URL pattern - WooCommerce uses /checkout/order-received/{id}/ as the thank-you page URL. Your trigger should use Page Path contains order-received rather than an exact match.

Step-by-step debugging checklist

  1. Verify GTM is installed - Visit your site, right-click → View Page Source, search for “GTM-”. If you don’t see it, GTM isn’t installed.
  2. Check GTM Preview mode - In GTM, click Preview. Navigate your site and trigger the event. Look for your tag in the Tags Fired section.
  3. Check the trigger - If the tag shows as “Not Fired”, click on it to see which trigger conditions aren’t met.
  4. Verify the dataLayer push - On the thank-you/order-received page, open the browser console and type dataLayer. Look for a purchase event with transaction_id, value, and items.
  5. Check the GA4 tag configuration - Make sure your GA4 Event tag uses the correct dataLayer variable names for transaction_id, value, currency, and items.

WordPress / WooCommerce-specific issues

WooCommerce’s thank-you page URL follows the pattern /checkout/order-received/12345/?key=wc_order_abc123. Use a Page Path trigger with the condition “contains order-received” to reliably detect this page.

For the dataLayer purchase event, you need a WooCommerce-to-dataLayer integration. Plugins like “GTM4WP” or custom code in your theme’s functions.php can push order details (transaction ID, revenue, items) into the dataLayer on the order-received page.

How to verify it’s working

  1. Open GTM Preview/Debug mode
  2. Navigate to your site
  3. Trigger the event (complete a test purchase)
  4. Check the GTM debug panel - your tag should appear under “Tags Fired”
  5. Check GA4 DebugView (GA4 → Admin → DebugView) to confirm the event arrived

Still didn’t work?

Our team can help. Describe what’s happening and we’ll get back to you within 24 hours.

Still didn't work? Report this issue

Fill in the details below and our team will review it within 3-5 business days. We aren't obliged to refund - but if we genuinely can't make it work, we may credit you back. Either way, your credits remain usable on a different event or site.

No need to type https:// - we'll add it for you.

Min 20 characters (0/20).

Context automatically included: purchase tracking on wordpress

Skip the manual setup

TrackingCoder detects your CMS and plugins automatically, then generates ready-to-use tracking code. No more adapting generic tutorials - get code tailored to your exact setup in under 2 minutes.

Try TrackingCoder Free →

2 free credits on signup. No card required.