Install on Shopify

Shopify needs two pieces:

  1. Theme code — the GTM snippet in theme.liquid
  2. Customer Events Pixel — for checkout events that fire on Shopify's checkout subdomain

Skip the Customer Events Pixel only if you don't need purchase / checkout tracking.

Step 1 — Paste GTM into theme.liquid

  1. In Shopify Admin, go to Online Store → Themes
  2. Find your active theme → Actions → Edit code
  3. Under Layout, open theme.liquid
  4. Find the <head> tag (usually near the top)
  5. Paste the GTM head snippet (shown in the wizard's Shopify Install tab) immediately after <head>
  6. Find the <body> tag
  7. Paste the GTM noscript snippet immediately after <body>
  8. Click Save

Step 2 — Add the Customer Events Pixel

Shopify's checkout runs on a separate domain (checkout.shopify.com) where theme code doesn't execute. To fire add_to_cart,purchase, and similar events from the checkout, you need a Customer Events Pixel.

  1. In Shopify Admin, go to Settings → Customer events
  2. Click Add custom pixel
  3. Give it a name like "TagEasy DataLayer Pixel"
  4. Paste the JS shown in the wizard's Shopify Install tab → Step 3 card
  5. Click Save, then Connect when prompted
  6. Under Customer privacy, set the permissions appropriate to your jurisdiction

That pixel listens to Shopify's checkout events (product_viewed,product_added_to_cart, checkout_completed) and pushes equivalent dataLayer events back to your storefront so GTM picks them up.

Step 3 — Verify with GTM Preview

  1. In GTM, click Preview (top-right)
  2. Enter your storefront URL
  3. Walk through the buyer journey: view product → add to cart → checkout → completed purchase
  4. Each step should fire the corresponding tag in GTM's Debug panel

Pre-built event templates for Shopify

These are already provisioned for you when you pick "e-commerce funnel" in the wizard:

  • shopify:ga4:view_item
  • shopify:ga4:add_to_cart
  • shopify:ga4:begin_checkout
  • shopify:ga4:purchase (requires the Customer Events Pixel)

Common gotchas

  • Theme app extensions — Some themes use app blocks for header/footer code. If theme.liquid doesn't take, look for an app extension and add the snippet there.
  • Online Store 2.0 — fully supported; same install path.
  • Shopify Plus checkout extensibility — uses the same Customer Events Pixel API. No additional config.
  • Headless storefront — skip the theme.liquid step; install GTM directly in your top-level layout. The Customer Events Pixel still applies if you use Shopify checkout.