GA4 Purchase Event Missing on Shopify? Fix It Now

GA4 Purchase Event Missing on Shopify? Fix It Now

March 7, 2025

Your Shopify orders are coming in, but GA4 shows zero purchases. Or worse — GA4 reports half the revenue Shopify does, and you have no idea which campaigns actually drive sales.

If your GA4 purchase event isn't firing on Shopify, you're flying blind on ad spend, ROAS, and product performance. The good news: this is one of the most common Shopify tracking issues, and it's fixable.

This guide walks you through diagnosing exactly why your GA4 purchase event is missing and how to fix it. No guesswork — just a clear diagnostic path from broken to verified.

Not sure where your tracking stands? Run a free GA4 audit to get a health score in 60 seconds.

What the GA4 Purchase Event Actually Does

The GA4 purchase event fires when a customer completes checkout on your Shopify store. It sends transaction data to Google Analytics 4 — order ID, revenue, tax, shipping, and every item in the cart.

Here's what a working purchase event looks like in the dataLayer:

{
  event: 'purchase',
  ecommerce: {
    transaction_id: '5678',
    value: 89.99,
    tax: 7.20,
    shipping: 5.99,
    currency: 'USD',
    items: [
      {
        item_id: 'SKU-042',
        item_name: 'Organic Cotton Tee',
        price: 34.99,
        quantity: 2
      }
    ]
  }
}

Without this event, GA4 can't calculate revenue, track conversions, or feed data back to Google Ads for smart bidding. Your ad platforms optimize on incomplete data, burning budget on traffic that doesn't convert.

The purchase event sits at the end of the ecommerce funnel: view_item > add_to_cart > begin_checkout > purchase. If the earlier events work but purchase doesn't, the problem is almost always on the checkout or thank-you page.

Quick Diagnosis: Why Is Your Purchase Event Missing?

Before you start debugging, figure out which scenario matches yours:

Scenario 1: No purchase events at all. GA4 shows zero purchase events, even though Shopify has orders. Jump to Check Your Tracking Installation.

Scenario 2: Some purchases tracked, but numbers don't match. GA4 captures 50-70% of what Shopify shows. Jump to Fix Partial Tracking Loss.

Scenario 3: Purchase events are doubled. GA4 shows more revenue than Shopify. Jump to Fix Duplicate Purchase Events.

Scenario 4: Purchase events stopped working. Everything was fine last month, now it's broken. Jump to Tracking Suddenly Broke.

💡 Pro Tip: Analytics Agent automatically tracks all these metrics for you. Install Analytics Agent and get instant insights without the manual work.

Check Your Tracking Installation

If GA4 shows zero purchase events, start here.

Step 1: Verify Your GA4 Tag Fires on the Thank-You Page

The purchase event fires on Shopify's order confirmation page (the thank-you page). If your GA4 tag doesn't load there, no purchase data reaches GA4.

Open your store. Place a test order using Shopify's Bogus Gateway. On the thank-you page, open Chrome DevTools (F12) and type in the Console:

dataLayer

You should see an array that includes a purchase event object. If dataLayer is empty or undefined, your tracking code isn't running on this page.

Fix: If you're using Google Tag Manager, make sure GTM is installed in Shopify's Settings > Checkout > Order status page > Additional scripts. The GTM snippet must load on the thank-you page, not just your theme.

Step 2: Confirm Your Measurement ID

A wrong Measurement ID is the most basic — and most overlooked — cause. In your GA4 property, go to Admin > Data Streams > Web and copy the ID (format: G-XXXXXXXXXX). Compare it character by character with what's in your GTM tag or Shopify pixel config.

Step 3: Check for JavaScript Errors

On the thank-you page, open the Console tab in DevTools. Look for red error messages. A single syntax error can prevent all tracking code from executing.

Common culprits:

  • Product names with apostrophes or quotes breaking the JavaScript
  • Missing | divided_by: 100.0 filter causing price values in cents instead of dollars
  • A trailing comma in the items array after the last product

Fix product name issues by adding Liquid filters:

item_name: "{{ line_item.title | remove: "'" | remove: '"' }}"

Step 4: Use GA4 DebugView

In GA4, go to Admin > DebugView. Place another test order. You should see the purchase event appear within 30 seconds.

If other events show up (page_view, add_to_cart) but purchase doesn't, the problem is isolated to the checkout/thank-you page. If nothing shows up, your GA4 Configuration tag itself isn't working.

Still stuck? Run a free GA4 audit — it checks your purchase event, 15 other ecommerce events, and gives you a prioritized fix list.

Fix Partial Tracking Loss

If GA4 captures some purchases but consistently shows 20-40% less revenue than Shopify, these are the likely causes.

Third-Party Payment Gateways

When a customer pays through PayPal, Klarna, or Afterpay, they leave your Shopify checkout. Some never return to the thank-you page where your tracking fires. No thank-you page visit = no purchase event.

Fix options:

  • Server-side tracking captures completions regardless of the customer's return path. This is the most reliable fix.
  • Ensure your payment gateway redirects customers back to the Shopify thank-you page after payment.
  • Accept some data loss for these payment methods (typically 5-15% of orders).

Ad Blockers and Privacy Restrictions

About 30% of users run ad blockers that prevent GA4 from loading. iOS Safari's Intelligent Tracking Prevention adds another layer. This is a structural gap — client-side tracking will never capture 100% of orders.

Realistic expectations by setup method:

Method Expected Accuracy
Shopify native (Google & YouTube app) 60-80%
Google Tag Manager (client-side) 75-85%
Server-side tracking 95-98%

If your capture rate falls within these ranges, your tracking is working correctly. If it's significantly worse, keep debugging.

🔍

See Analytics Agent in Action

Discover how AI-powered insights can transform your Shopify store.

Learn More →

Shop Pay Domain Issues

Shop Pay can redirect customers to shop.app, which breaks tracking if your GA4 setup only covers your main domain. Verify that cross-domain tracking is configured for shop.app and checkout.shopify.com in your GA4 data stream settings.

Missing first_time_accessed Check

If you're using custom dataLayer code on the thank-you page, wrap it in Shopify's first_time_accessed condition:

{% if first_time_accessed %}
<script>
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    event: 'purchase',
    ecommerce: {
      transaction_id: "{{ checkout.order_id }}",
      value: {{ checkout.total_price | divided_by: 100.0 }},
      tax: {{ checkout.tax_price | divided_by: 100.0 }},
      shipping: {{ checkout.shipping_price | divided_by: 100.0 }},
      currency: "{{ checkout.currency }}",
      items: [
        {% for line_item in checkout.line_items %}
        {
          item_id: "{{ line_item.product_id }}",
          item_name: "{{ line_item.title | remove: "'" | remove: '"' }}",
          price: {{ line_item.final_price | divided_by: 100.0 }},
          quantity: {{ line_item.quantity }}
        }{% unless forloop.last %},{% endunless %}
        {% endfor %}
      ]
    }
  });
</script>
{% endif %}

Without first_time_accessed, the event may not fire at all on some Shopify checkout configurations, or it may fire multiple times on page refreshes.

Fix Duplicate Purchase Events

If GA4 shows more revenue than Shopify, you have duplicate purchase events. This happens when multiple tracking implementations fire simultaneously.

Step 1: Check for Overlapping Implementations

The most common cause: you have the Google & YouTube channel app connected AND custom GA4 code in your theme or GTM. Both fire a purchase event for the same order.

How to check:

  1. Go to Settings > Customer events in Shopify admin. Look for connected pixels.
  2. Check your GTM container for GA4 tags.
  3. Search your theme code (theme.liquid) for any gtag or GA4 measurement ID references.

Fix: Pick one implementation method and remove the others. If you use GTM, disconnect the Google & YouTube app's GA4 pixel.

For a complete guide on identifying and removing duplicate tags, see our duplicate GA4 tags fix guide.

Step 2: Add localStorage Deduplication

For extra protection against duplicates, add a localStorage check:

var orderId = "{{ checkout.order_id }}";
if (!localStorage.getItem("ga4_purchase_" + orderId)) {
  // your dataLayer.push code here
  localStorage.setItem("ga4_purchase_" + orderId, "true");
}

This prevents the purchase event from firing again even if a customer bookmarks and revisits the thank-you page.

Tracking Suddenly Broke

If purchase tracking was working and stopped, something changed. Here's how to find what.

Check these in order:

  1. Shopify app updates. Did the Google & YouTube channel app update? Reconnect it in Settings > Customer events.
  2. Theme updates. A theme update can overwrite custom code in theme.liquid. Re-add your GTM snippet if it's missing.
  3. Checkout Extensibility migration. Shopify is migrating all stores to Checkout Extensibility. If your store was migrated, scripts in Additional Scripts may no longer fire. Move tracking to Custom Pixels.
  4. GTM container changes. Check GTM > Admin > Container Versions to see if someone published a change that broke the purchase tag.
  5. GA4 property changes. Verify your data stream is still active in Admin > Data Streams.

For related fixes, see our guide on fixing Shopify tracking issues or learn how to detect duplicate GA4 tags that cause data inflation.

Verify Your Fix

After applying any fix, run through this verification:

  1. Enable Shopify's Bogus Gateway in Settings > Payments.
  2. Place a test order with 2+ items and a discount code.
  3. On the thank-you page, open DevTools Console and confirm the dataLayer contains your purchase event.
  4. In GA4, check DebugView — the purchase event should appear within 30 seconds.
  5. Verify the transaction_id, value, and items array all match your test order.
  6. Wait 24-48 hours, then compare GA4's Ecommerce Purchases report to your Shopify order.

Weekly check: Compare GA4 purchase count to Shopify orders every Monday. If GA4 captures 85-95% of orders (client-side) or 95%+ (server-side), your tracking is healthy.

💡 Pro Tip: Analytics Agent automatically tracks all these metrics for you. Install Analytics Agent and get instant insights without the manual work.

FAQ

Why does GA4 show fewer purchases than Shopify?

GA4 client-side tracking misses 15-30% of orders due to ad blockers, iOS privacy restrictions, and third-party payment redirects (PayPal, Klarna). A 10-20% gap is normal. If the gap exceeds 30%, you likely have a tracking configuration problem.

How do I test if my purchase event is firing?

Place a test order using Shopify's Bogus Gateway. On the thank-you page, open Chrome DevTools Console and type dataLayer to inspect the purchase event. Simultaneously check GA4 DebugView for the event.

Can I use the Google & YouTube app and GTM at the same time?

No. Running both creates duplicate purchase events — GA4 will show double the actual revenue. Choose one method. GTM offers more control and better debugging, but the Google & YouTube app is easier to maintain.

My purchase event fires but shows $0 revenue. What's wrong?

The value parameter is likely sent as a string instead of a number, or the currency parameter is missing. Check your dataLayer code: value should not have quotes around it, and currency must be a three-letter ISO code like "USD".

Will the Shopify Checkout Extensibility changes break my tracking?

Potentially. Shopify is deprecating checkout.liquid and the Additional Scripts field. If your purchase tracking relies on scripts in Additional Scripts, you need to migrate to Custom Pixels or the Web Pixel API before the deadline hits your store.

Next Steps

Your GA4 purchase event is the single most important ecommerce tracking event. Without it, marketing attribution, automated bidding, and revenue reporting all fall apart.

If you've followed this guide and your tracking is verified, set up a weekly comparison between GA4 and Shopify to catch any future breaks early. For a deeper look at your entire GA4 implementation, check out our GA4 setup guide for Shopify.

Ready to stop guessing? Run a free GA4 audit to see your full tracking health score and get prioritized fixes in 60 seconds.

Ready to Unlock Your Analytics Potential?

Connect Analytics Agent to your Shopify store and start making data-driven decisions today.

Get Started Free