Troubleshooting

Purchase/Transaction Tracking Not Working on Shopify

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. Shopify checkout runs on checkout.shopify.com - You cannot add custom GTM containers to Shopify’s checkout pages. Use Shopify’s native conversion tracking, Customer Events (in Shopify admin), or Shopify’s Web Pixels API for checkout and purchase tracking.

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.

Shopify-specific issues

Shopify’s checkout is hosted on checkout.shopify.com (a separate domain you don’t control). You cannot add custom GTM or JavaScript to this domain. For purchase tracking, use one of these approaches:

  • Shopify Customer Events - In Shopify admin → Settings → Customer Events, you can add pixel code that fires on checkout events including checkout_completed.
  • Web Pixels API - Shopify’s newer Web Pixels API runs in a sandbox on the checkout page and can send events to GA4, Meta, and other platforms.
  • Order status page script - Add tracking code to Settings → Checkout → Order status page → Additional scripts. This fires after purchase but has limitations (doesn’t fire if the user closes the tab before reaching the 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 shopify

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.