Script Tags not loaded on Checkout Order Status page

I have successfully created ScriptTag with order_status scope via rest API.

The problem is that script tag is loaded only on page that is visible through admin link on “View Order Status Page” in Shopify order administration, NOT when customer complete checkout and gets redirected on “Order Status” page.

I have tried the same with “Additional scripts” in Checkout Settings, but I get the same result.

Are there some conditions when script tags are loaded on “Order Status” page? Why script is not loaded on “Order Status” page after checkout?

4 Likes

Hello @anovak ,

Greetings! I am Gina from the flareAI app helping Shopify merchants get $6Million+ in sales from Google Search, on autopilot.

To troubleshoot this issue, you can try the following:

→ Double-check that you created the Script Tag correctly with the right settings.

→ Make sure you set the scope to “checkout_order_status” when creating the Script Tag.

→ Make sure your script tag is compatible with the current version of Shopify by referring to their documentation.

→ Reduce the size of your script tag.

→ Verify the formatting of your script tag.

→ Temporarily disable any browser extensions or ad blockers you’re using.

→ Clear your browser cache or try using a private browsing window to test the page without cached scripts.

→ Check if your theme allows loading external scripts on the “Checkout Order Status” page.

→ Make sure your script doesn’t have any errors and works on a regular HTML page.

→ Disable any Shopify apps that modify the checkout process or order status page to see if they’re causing conflicts.

→ If the issue persists, contact Shopify’s support or developer community for further help.

Please don’t hesitate to reach out if you require any additional assistance.

Gina

Hello,

For security reasons, only the order confirmation page (last page) is allowed to load script-tags.

But the order confirmation page (last page) in front Store didn’t load the script-tags. The ORDER_STATUS of displayScope only works on the admin page. How can I inject script-tags on thank-you?

Currently in my case script tags are loaded when I access “the order confirmation page (last page)” through admin link, or through button in order confirmation email.

Script is not loaded on “the order confirmation page (last page)” after checkout is completed.

Link example:
https://xxx-shop.com/77014630686/orders/ae1a3dc5ea160decd41ae3390d4164b5 ← script loaded

https://xxx-shop.com/checkouts/cn/c1-491b99dcffd7ce2bf319d81d3be837f4/thank-you ← script not loaded

Visually both pages looks the same.

you can try setting the display_scope attribute of the script tag to all (“display_scope”: “all”) then detect and run the code on front store order confirmation page with javascript.

Thanks @gthibault ,

I got it work. It is work fine that the scrip tag load when I test my app in dev stores which is Global Nav dev store. But it is not work anymore when I test my app in dev stores which is checkout extensibility developer preview.

Hopely it is useful information.

Otherwise, to add code, you can try the theme application extension for new themes (2.0).

https://shopify.dev/docs/apps/online-store/theme-app-extensions

ScriptTag is now an alternative for old themes.

Hi, Anovak

I’m aware this is a late reply but wanted to share to help other developer come looking for.

Shopify has been slowly turning off the additional scripts on thank you and order status page. Merchants can opt-in by themselves as well. Checkout more from Nov 23 - https://shopify.dev/changelog/ui-extensions-on-the-thank-you-and-order-status-pages-have-launched.

There has been more recent updates about the same in the month of May - https://shopify.dev/changelog/new-checkout-functionality-for-merchants-on-basic-shopify-and-advanced-plans.

Shashank