Shopify Tracking in 2026: Complete GA4 & Server-Side Guide

Post-checkout.liquid architecture, Customer Events sandbox, 14 e-commerce events, Cookie Restore, Elevar vs Stape vs Addingwell.

Shopify’s 2024 Architectural Change

In August 2024, Shopify deprecated checkout.liquid, the file that allowed injecting custom code directly into checkout pages. This change broke tracking for thousands of stores overnight. The GA4 or GTM scripts that merchants had placed in the checkout no longer work.

The recommended approach now relies on two complementary mechanisms: Theme Liquid for site pages (collection, product, cart) and Customer Events for the checkout. Customer Events are a sandboxed environment (an isolated pixel in an iframe) that imposes specific constraints on tracking.

Understanding this architecture is essential for implementing reliable e-commerce tracking on Shopify in 2026.

The 14 Standard E-Commerce Events

GA4 defines a sequence of e-commerce events covering the entire purchase journey. On Shopify, you must implement each of these events in the correct technical context.

In Theme Liquid: view_item_list (collection page), select_item (product click), view_item (product page), add_to_cart (add to cart), remove_from_cart, view_cart, and begin_checkout.

In Customer Events (sandbox pixel): add_shipping_info, add_payment_info, purchase, and optionally refund via server-side webhook.

The view_promotion, select_promotion, and view_search_results events are optional but recommended for stores with promotional banners and active internal search.

A classic trap I regularly encounter during my GA4 and GTM setup engagements: never send the client_id inside e-commerce items objects. This parameter does not belong in the e-commerce payload and artificially inflates (not set) values in your product reports.

The Sandbox Environment Debugging Trap

Shopify’s Customer Events execute in a sandboxed pixel environment, meaning an iframe isolated from the rest of the page. This isolation has a major practical consequence: GTM preview mode does not work in this environment.

When you activate GTM preview mode, it injects a script into the main page. But checkout events fire from the pixel iframe, beyond the GTM debugger’s reach. You will not see any checkout events in preview mode.

The solution: open your browser’s developer tools, navigate to the pixel iframe in the console’s context selector, and inspect network requests from that iframe. This is the only reliable way to debug checkout tracking on Shopify.

Alternatively, use GA4’s DebugView by activating the debug_mode parameter directly in your pixel configuration. It is less granular than GTM preview mode, but it confirms that events are reaching GA4.

Shopify’s checkout restricts access to main domain cookies. When a user transitions from the site to the checkout (which runs on a subdomain or in a sandboxed context), first-party cookies are not accessible. The GA4 client_id is lost, creating fragmented sessions and duplicate users.

The solution is Cookie Restore, a server-side technique that stores the client_id on the server and restores it during the checkout transition. The principle: when the user reaches the checkout, a server-side call retrieves their original client_id and reinjects it into the GA4 hit. This guarantees session continuity and correct conversion attribution.

This technique is essential for any server-side tracking setup on Shopify and is part of the configurations I systematically implement.

Specialized Apps and Approaches

Three applications dominate the Shopify tracking market. Elevar positions itself on conversion rate optimization with a prebuilt data layer and a no-code interface. Stape focuses on server-side tracking with native Customer Events integration. Addingwell offers a native Shopify app that handles proxying and Cookie Restore.

The choice depends on your priority: if your main concern is GA4 e-commerce tracking with quick setup, Elevar is a good starting point. If you need full control over data collection and GDPR compliance, a server-side approach with Stape or Addingwell will be more suitable.

In all cases, systematically test the complete journey (view_item through purchase) in a Shopify staging environment before deploying to production. A missing or duplicate purchase event has a direct impact on your marketing decisions.

Need help with this topic?

I can help you implement or optimize your tracking setup.

Book a call