Don't have one? Create one ↗
← All courses

Lesson 15 of 16

Shopify Checkout_Completed

① Connect your GTM container

Paste your container ID to load it into this page. It only ever runs here.

Advanced: use a specific environment

Shopify's checkout runs in its own sandbox, so the usual on-page dataLayer pushes don't reach it. The bridge is a custom pixel: a small script you add in Shopify that subscribes to the checkout_completed Customer Event and pushes the order into the dataLayer for GTM.

The button below emits the exact object that pixel sends, order id, currency, value and an items array. Your job on the GTM side is the Data Layer Variables, the Custom Event trigger and the GA4 purchase tag that turn it into a clean conversion.

Goal

Build Data Layer Variables for the checkout_completed payload, a Custom Event trigger on it, and a GA4 purchase tag.

Build it in GTM

  1. Add a Data Layer Variable per field

    Create DLVs for orderId, currency, value, shipping, tax and items. The names must match the keys in the push exactly.
  2. Create a Custom Event trigger

    Trigger type Custom Event, event name checkout_completed, it must match the event key in the push.
  3. Build a GA4 purchase tag

    A GA4 Event tag named purchase, mapping transaction_id orderId, plus value, currency, shipping, tax and items. Fire it on the trigger above.
  4. Verify in Preview

    Confirm the tag fires once and every parameter shows the real order value.

Debug in Tag Assistant

Copy this lesson's live URL and paste it into GTM Preview, that is the page Tag Assistant connects to. It has the clickable elements, so this page stays clean for reading.

  1. In your GTM, click Preview.
  2. Paste the live URL above and click Connect.
  3. Interact with the live page and watch your tag fire in Tag Assistant.

What you should expect to see

A single GA4 purchase with transaction_id = gid://shopify/Order/5123456789, value = 129, currency = USD, and a two-row items array.

Verify your container

Built it? Export your container, Admin → Export Container, choose your workspace, then drop the JSON here to check it against this lesson.

Drop your container .json here

or browse · checked in your browser, nothing is uploaded