Shopify gives you two paths for tracking: their native Web Pixel API (introduced with checkout extensibility) and the classic Google Tag Manager approach. They’re not interchangeable — each has access to different events, different pages, and different data.
Here’s the honest comparison.
What Each One Actually Is
Shopify Web Pixels
A JavaScript sandbox that runs inside Shopify’s Web Worker. You write tracking code that subscribes to Shopify’s standardized events (product_viewed, checkout_completed, etc.). The code runs in isolation — no DOM access, no cookie reading via document.cookie, limited API surface.
Key constraint: Web Pixels run in a sandbox. They can’t inject scripts into the page, modify the DOM, or read arbitrary cookies. They can only access what Shopify’s API exposes.
Google Tag Manager
A container that loads on every page and fires tags based on triggers you configure. Full access to the DOM, cookies, data layer, and any JavaScript you want to run.
Key constraint on Shopify: GTM can’t run on checkout pages (Shopify locks them down). So your most critical conversion event (purchase) is invisible to GTM unless you use workarounds.
The Comparison
| Capability | Web Pixels | GTM |
|---|---|---|
| Checkout page access | Yes (native) | No (blocked by Shopify) |
| Purchase event | Yes | Only via thank-you page scripts or webhooks |
| Product page events | Yes | Yes |
| Add to cart | Yes | Yes (with data layer) |
| Custom JavaScript | Limited (sandbox) | Unlimited |
| Cookie access | Limited (_shopify_y, click IDs) | Full (document.cookie) |
| DOM manipulation | No | Yes |
| Third-party scripts | No (can’t inject) | Yes |
| Server-side events | Via POST to your server | Via sGTM or data layer |
| Consent management | Shopify’s consent API | Full CMP integration |
| Platform support | Any (you write the code) | Any (via tags) |
| Debugging | Limited (no preview mode) | GTM Preview Mode |
When to Use Web Pixels Only
- Simple tracking needs: GA4 + Meta Pixel + 1-2 other platforms
- Shopify Plus not available: Standard Shopify plans restrict checkout customization
- You want Shopify to manage updates: Pixel API updates when Shopify updates events
- Shop Pay tracking is critical: Web Pixels fire during Shop Pay checkout flows that GTM misses entirely
When to Use GTM Only
- Complex tag management: 10+ tags with conditional logic, sequencing, and variables
- Non-Shopify pages in the flow: Blog, landing pages, or microsites on different platforms
- Advanced remarketing: Custom audience building, scroll tracking, video tracking
- Heatmaps and session recording: Tools like Hotjar, FullStory, or Clarity need DOM access
The GTM-only problem: You miss checkout events. The purchase event won’t fire unless you add tracking to the thank-you page via Shopify’s “Additional scripts” field or use server-side webhooks.
The Hybrid Approach (Recommended)
Use both. Let each do what it’s best at:
Web Pixels:
→ Checkout events (begin_checkout, add_payment_info, purchase)
→ Shop Pay purchase recovery
→ Server-side CAPI dispatch
GTM:
→ Pre-checkout events (page_view, product views, add to cart)
→ Custom events and advanced tracking
→ CMP integration
→ Third-party tools (heatmaps, chat, etc.)
Deduplication: Both systems fire events with the same event_id format (using the checkout token). Platforms like GA4 and Meta deduplicate by event_id, so you don’t get double-counted conversions.
How to Set Up the Hybrid
Step 1: Install GTM on your Shopify theme (via theme.liquid or Shopify’s Custom Pixels for non-checkout pages)
Step 2: Deploy a Web Pixel for checkout tracking (via Shopify Admin → Settings → Customer events)
Step 3: Ensure event IDs are consistent between GTM data layer pushes and Web Pixel event dispatches
Step 4: Test with GTM Preview Mode for GTM tags and browser DevTools Network tab for Web Pixel events
Server-Side: The Common Ground
Both approaches benefit from server-side tracking:
- Web Pixels + server-side: Pixel sends events to your server → server dispatches to Meta CAPI, GA4 Measurement Protocol, etc.
- GTM + server-side GTM: Client-side GTM sends to sGTM container → sGTM dispatches to platforms
The end result is the same: server-side events that bypass ad blockers and iOS restrictions. The architecture is different but the outcome is identical.
Migration Path
If you’re currently on GTM and considering Web Pixels:
- Don’t rip out GTM. Add Web Pixels alongside it.
- Move checkout tracking to Web Pixels (this is the biggest win — you gain checkout visibility)
- Keep GTM for everything else (pre-checkout events, custom tracking, third-party tools)
- Test dedup before going live — complete a test purchase and verify you see exactly ONE purchase event in each platform
If you’re starting from scratch, the hybrid approach is the way to go. Need help setting it up? Run a free tracking scan first to see what you currently have.