Blog

Complete GA4 eCommerce Tracking on Shopify with Google Tag Manager

January 15, 2024

If your Shopify sales data in GA4 doesn’t match your Shopify backend, this guide is for you. We’ll walk through setting up professional-grade GA4 eCommerce tracking on Shopify using Google Tag Manager — including the Data Layer, custom HTML tags, triggers, and server-side best practices.

Why your GA4 numbers are off

Most Shopify stores rely on the default GA4 integration from Shopify, which is unreliable: it misses key events, double-counts checkouts, and doesn’t capture refunds. With GTM and a custom Data Layer, you can fix every one of those issues.

What you’ll need

  • Shopify store (any plan)
  • GA4 property + Google Tag Manager container
  • ~30 minutes to set up

Step 1: Add a custom Data Layer

Inject a custom Data Layer into your theme.liquid or via Shopify’s Customer Pixel API. Push the order data on the Thank You page.

Step 2: Build GTM triggers and tags

Use a Data Layer event trigger and configure your GA4 event tag to send purchase, add_to_cart, view_item, etc.

Step 3: Validate in GA4 DebugView

Use GA4’s DebugView to confirm every event is firing correctly before publishing.

Need help?

I do this professionally for Shopify & WooCommerce stores — book a free audit.