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
Add a Data Layer Variable per field
Create DLVs fororderId,currency,value,shipping,taxanditems. The names must match the keys in the push exactly.Create a Custom Event trigger
Trigger type Custom Event, event namecheckout_completed, it must match theeventkey in the push.Build a GA4 purchase tag
A GA4 Event tag namedpurchase, mappingtransaction_id→orderId, plusvalue,currency,shipping,taxanditems. Fire it on the trigger above.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.
- In your GTM, click Preview.
- Paste the live URL above and click Connect.
- Interact with the live page and watch your tag fire in Tag Assistant.
What you should expect to see
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