Tracking and analytics Guide 7 min read

Shopify GA4 Ecommerce Tracking: How to Audit It Properly

Can you trust your Shopify GA4 ecommerce tracking? Find every tracking source, test events with a real checkout, catch duplicate purchases and reconcile revenue.

In this guide

Key takeaways

  • Trust GA4 only after four checks: one purchase per order, revenue that reconciles with Shopify, funnel events carrying the right data, and traffic sources that are not polluted by your own checkout.
  • Find every tracking source first: Shopify's Google and YouTube app, Customer events pixels, theme code and Tag Manager. Two sources for one event means duplicates.
  • Test with a real checkout in your payment provider's test mode, and watch GA4 DebugView or Tag Assistant while you do.
  • A stable gap you can explain, such as refunds, shipping and tax, is normal. A gap that keeps growing is a bug.

To trust GA4 on a Shopify store, check four things: each purchase fires once, revenue matches Shopify within a gap you can explain, the funnel events carry the right data, and your traffic sources are not polluted by your own checkout. The audit below takes an afternoon and finds most problems. Do it before you make decisions based on conversion rates, ad return or funnel drop-off.

Find every place that sends data to GA4

Most Shopify stores send data from more than one place, and that is where duplicates start. Look in each of these:

  1. Shopify admin, Settings, Customer events. This lists every pixel that is running, including apps such as the Google and YouTube channel and any custom pixels someone added.
  2. Your theme code. Search theme.liquid and the snippets folder for gtag(, googletagmanager.com and G- measurement IDs.
  3. Google Tag Manager. Open the container and list the GA4 tags, and the triggers they use.
  4. GA4 itself. In Admin, check how many web data streams and properties exist. A forgotten second property still receives data.
  5. Other apps. Review, loyalty and ad apps often add their own tracking.

Shopify has been replacing checkout.liquid and the Additional scripts box with checkout extensibility and customer events. If your purchase tracking still lives in either of them, confirm it still fires instead of assuming it does. Shopify’s web pixels documentation explains the replacement.

Write down which source is meant to send which event. Two sources for the same event is the first thing to fix.

Check the events GA4 expects

Google recommends a set of ecommerce events in the order of a shopping journey. Shopify exposes matching standard events to pixels. Use this mapping to check coverage:

GA4 event Shopify standard event What to verify
view_item_list collection_viewed Fires on collection pages with the products listed
view_item product_viewed Right product ID, name, price and currency
add_to_cart product_added_to_cart Quantity and variant are correct
view_cart cart_viewed Fires once per cart view
begin_checkout checkout_started Items and value match the cart
add_shipping_info checkout_shipping_info_submitted Shipping tier is sent
add_payment_info payment_info_submitted Fires once, not on every keystroke
purchase checkout_completed Once per order, with transaction ID, value, currency and items

You do not need every event. A store that wants clean funnel reports needs view_item, add_to_cart, begin_checkout and purchase, with the right data. Add the others when someone will use them.

Run a test order and watch it live

Reading code does not prove tracking works. A real checkout does.

  1. Turn on your payment provider’s test mode, or plan one low-value live order that you will refund.
  2. Open GA4 DebugView in the admin, or start Tag Assistant if you use Tag Manager.
  3. In a private browser window, go through the full path: collection, product, cart, checkout, payment.
  4. At each step, confirm the event appeared once and carries the data you expect.

When you need to see what Shopify itself sends, a temporary custom pixel can log every standard event. Add it under Customer events and remove it after the test:

// Customer events: custom pixel for testing only. Logs every standard event.
analytics.subscribe("all_standard_events", (event) => {
  console.log(event.name, event.data);
});

Pixels run in a sandbox. If you do not see output in the browser console, pick the pixel’s frame from the console’s context selector.

For the purchase event, check these fields against the order in Shopify:

  • transaction_id is present, and it is the same value every time for the same order. Google requires it for purchases.
  • value and currency are correct. Google’s convention for value is the sum of price times quantity for all items, with shipping and tax sent as separate parameters.
  • items has the right products, quantities and prices.

Hunt for duplicate purchases

Duplicate purchases inflate revenue and ruin conversion rates. The common causes:

  • Two tags send the same purchase, for example a Tag Manager tag and an app pixel.
  • A customer reloads the order confirmation page and the tag fires again.
  • Two GA4 data streams or properties are configured, and the numbers get added together in a report.
  • A Google Ads conversion tag is installed both through an app and by hand.

To find them in GA4, open Explore and create a free-form report with Transaction ID as the rows and Event count as the values. Filter to Event name equals purchase and sort the count in descending order. Any transaction ID with a count above one was recorded twice. Fix the cause, not the report: remove one of the sources or add a guard so the tag cannot fire twice for the same order.

Reconcile revenue with Shopify

Compare the same period in both tools, in the same time zone and currency. Then compare orders and revenue separately.

Differences you should expect and be able to explain:

  • Refunds and returns. GA4 only knows about them if you send a refund event.
  • Shipping, tax and discounts. Shopify’s reports can include these in ways that differ from how your value is built.
  • Orders that did not come through the web checkout. Point of sale, draft orders and subscription renewals.
  • Visitors you cannot measure. Consent choices, blockers and browser privacy features.

Write the explained gap down once. After that, check it monthly. A stable gap is normal. A gap that grows after an app install, a theme change or a checkout update is a bug, and the date it started tells you where to look.

Clean up your traffic sources

Wrong attribution is easier to miss than wrong revenue. Check:

  1. Unwanted referrals. In GA4 Admin, open your web data stream, then Configure tag settings, then List unwanted referrals. Add your payment providers and any checkout domain, so a customer returning from the payment page is not counted as a new visit from that site.
  2. Cross-domain measurement. If checkout runs on a different domain from the storefront, configure it so one visit stays one session.
  3. UTM tags. Values are case sensitive, so Email and email become two sources. Pick lowercase and stick to it.
  4. Internal traffic. Exclude your team’s traffic so your own test orders do not distort reports.
  5. Large “Unassigned” or “Direct” shares. They usually point to missing UTM tags or links from apps and messages that strip referrers.

Tracking has to respect the rules for the people you sell to. Google’s consent mode lets tags adjust to a visitor’s choice through settings such as analytics_storage and ad_storage. It does not store the choice for you, so your consent tool has to do that.

For shops selling into the US, Canada and Australia, privacy rules differ by place, and some states and provinces have their own. This is a question for your legal advisor, not for a tag. What I can say from the technical side: test your banner. Open the store in a private window, decline tracking, and check that the tags you expect to be blocked really are.

A short checklist

  • Every tracking source is listed, and each event has exactly one.
  • view_item, add_to_cart, begin_checkout and purchase fire once with correct data.
  • A test order produces one purchase, with a stable transaction_id.
  • No transaction ID appears twice in GA4.
  • Orders and revenue are reconciled with Shopify, and the gap is explained.
  • Payment providers are in the unwanted referrals list.
  • Consent behavior was tested with tracking declined.
  • Heavy or unused tags are removed. They also slow the store, as covered in Shopify store slow on mobile.

Run this audit before a sale, not during it. The Black Friday readiness checklist shows where tracking checks fit in the weeks before one.

When to get help

Tracking work looks small and often is not. Bring in a developer when checkout customizations are involved, when you use headless or custom checkout pages, when subscriptions or multiple currencies complicate revenue, or when a past setup has left several pixels tangled together.

GA4 and Tag Manager tracking, consent, and conversion tests were part of my work on the Cosmo Together Shopify Plus store, which is in selected work. If your numbers do not add up, send me the store address and what you see. I will reply with what I think is causing it and what I would check first.

Common questions

Why does GA4 show fewer orders than Shopify?

The usual causes are visitors who decline consent, ad blockers and browser privacy features, a tag that fails on some payment methods or devices, and orders that never touch the web checkout, such as subscription renewals or point of sale. A small, steady gap is normal. A large or growing one deserves an audit.

Should I use Shopify's Google and YouTube app or Google Tag Manager?

Either can work. The app is quicker to set up. Tag Manager gives more control and is easier to extend with custom events. What matters is one source for each event. Do not run both for the same events.

Do I need server-side tracking?

Not to start. Server-side tagging can recover some data lost to browsers and blockers and gives more control over what you send, but it adds hosting cost and upkeep. Fix the basics first, then decide.

How do I test purchases without placing a real order?

Switch your payment provider to test mode and use its documented test card numbers. If you only have a live gateway, place one real low-value order and refund it. Watch GA4 DebugView or Tag Assistant during the checkout.

Sources and further reading

Tell me what's not working.

Send the store address and a few lines about the problem. I'll reply with what I think is causing it, what I'd do first, and whether I'm the right person for the job.

Email
hi@m-ali.dev
Based in
Islamabad, Pakistan, UTC+5. I usually reply within one business day.

This opens your email app with the message filled in.

I use your details only to reply to you. Privacy notice

Keep reading