How To Get The Order name On The Store Thanks Page

Topic summary

Main issue: push the order name to the Google Tag Manager (GTM) data layer on the store’s Thank You page.

Current state: order_id is accessible via Shopify.checkout.order_id.

Problem: no order_name field exists on Shopify.checkout. Attempting checkout.order_name results in the error “checkout is not defined,” indicating the checkout object isn’t available in that context.

Context: GTM data layer is a JavaScript object used to pass transaction details (e.g., order identifiers) to analytics. Shopify.checkout is a JavaScript object exposed during checkout, but availability/fields can differ on the Thank You page.

Ask: guidance on how to retrieve the order name (e.g., order_name) on the Thank You page for pushing to GTM.

Outcome: no solution provided yet; the thread is open and unresolved.

Summarized with AI on January 15. AI used: gpt-5.

Hi,

I’m working on an app recently and I need to push order name to data layer in Google Tag Management.

I can get order_id by using Shopify.checkout.order_id.

But there is no order_name in Shopify.checkout.

I tried using checkout.order_name but I got the error checkout is not defined.

Please help me.

Thanks.