Webclat / Ecommerce
ecomm.webclat.com

Now that Shopify deprecated checkout.liquid/Additional Scripts, how do I still fire a GTM purchase tag reliably?

Checkout Extensibility removed the field this used to live in. The fix isn't a workaround inside the old system - it's rebuilding the tag as a Web Pixels API pixel.

Quick answer

Additional Scripts and checkout.liquid injection are gone on Checkout Extensibility stores, so a purchase tag placed there no longer runs. The supported replacement is a custom pixel built on Shopify's Web Pixels API: subscribe to the checkout_completed customer event and push the order data to dataLayer (or send it directly to GA4/GTM) from inside the pixel's sandbox, rather than trying to inject the GTM container the old checkout.liquid way.

Why this happens

Shopify moved every store to Checkout Extensibility, which removed checkout.liquid and the Additional Scripts field entirely. Shopify's checkout is now a locked-down, sandboxed surface for security and performance reasons - merchants can no longer inject arbitrary third-party JavaScript directly into it. Any tag manager container that used to load via Additional Scripts simply stops running on the checkout and thank-you steps, which looks like "GTM stopped firing" even though nothing else on the store changed.

The replacement mechanism, the Web Pixels API, is not a like-for-like substitute - it's a different model. Instead of a tag manager owning the page and deciding what to load, Shopify owns the page and hands your code a curated stream of events (page_viewed, checkout_completed, and so on) inside a sandbox with no direct DOM access. GTM has to be rebuilt around that event stream rather than dropped in as a script tag.

Fix it

  1. Confirm you're on Checkout Extensibility: Settings > Checkout in the Shopify admin. If there's no Additional Scripts field at all, you're migrated and this is the cause.
  2. Go to Settings > Customer events and add a custom pixel (Shopify may offer a Google Tag Manager template; if not, use a blank custom pixel).
  3. Inside the pixel's sandboxed code editor, register a listener: analytics.subscribe("checkout_completed", (event) => { ... }).
  4. Inside that callback, read the order fields you need from the event payload - order id, total price, currency, and line items live under event.data.checkout - and push a purchase object shaped like your existing dataLayer schema.
  5. If you need the full GTM container rather than a single hardcoded event, load the GTM snippet itself inside the pixel's init code, then push to dataLayer from every analytics.subscribe callback you register, one per event you were previously tracking via Additional Scripts.
  6. Save the pixel, then explicitly switch it from "Disconnected" to "Connected" - pixels are created disconnected and do not fire until you turn them on.
  7. Rebuild any tag logic that used to read the DOM (scraping a price off the page, reading a data attribute) around the event payload instead - the sandbox has no document object, so DOM-scraping tags cannot be ported as-is.

Branch: if your GTM container also needs to fire on non-checkout pages (product, cart), that part is unaffected by this change - Additional Scripts removal is a checkout-only migration. Only checkout and thank-you page tags need to move to a custom pixel.

How to verify it worked

Runtime check

With the pixel connected, open DevTools > Network on a real (or test-mode) checkout, filter for your GTM/GA4 request domain (gtm.js, collect, or g/collect), and place one test order. Confirm a request fires immediately after the order confirms, carrying the correct transaction id and value. Then open GA4 DebugView (with debug mode enabled, or the GA4 Debugger browser extension) and confirm the purchase event appears within a few seconds of the order, with parameters matching what the network request sent. Cross-check the transaction id in that event against the order number shown in Shopify admin - a match on both the network request and DebugView within the same test order is what "verified" looks like here, not just "GTM Preview looked fine."

Find out what your tracking actually reports.

A runtime audit of your store: every tag that fires, every event that reaches your analytics and ad platforms, and where the numbers diverge from the orders table. Evidence first, opinions second.

Request an audit