Regard replacement of strip tag in checkout page using theme extension

Regard replacement of strip tag in checkout page using theme extension

flexshop1
Shopify Partner
1 0 0

Our Shopify app includes two custom JavaScript codes.  We  included js file in checkout page this by ScripTags, but recently we were notified that ScripTags are old and should be replaced with App Embeded Blocks (https://shopify.dev/apps/online-store/theme-app-extensions/extensions-framework#app-embed-blocks). We can use App Embeded block js inclusion but those blocks do not work in checkout pages. We were trying to use Post Purchase Checkout Extensions (https://shopify.dev/apps/checkout/post-purchase), but it looks like this options does not allow us to include custom script, only DOM elements, available from "

@Shopify/post-purchase-ui-extensions-react".
 
 
Is there any solution to achieve by theme extension or we can keep inclusion of js with script tag.
 
 
Please share your response.
 
Thanks
Reply 1 (1)

Dan_Nistor
Shopify Partner
42 1 8

Not 100% sure on this but, if you need to include custom JavaScript on the checkout page, you may still use the script tag method as it is supported on the checkout page. However, if you want to use the latest recommended approach, you can create a Shopify app with an embedded block that can be added to the theme code.

 

The embedded block can be used to include your custom JavaScript on the storefront pages, except the checkout page. For the checkout page, you can use the Post Purchase Checkout Extensions, which allows you to modify the post-purchase page, but not the checkout page. As you mentioned, this option does not allow you to include custom script, only DOM elements.

 

Therefore, it seems that the script tag method is the only viable option for including custom JavaScript on the checkout page. However, make sure to follow best practices, such as using asynchronous loading, minifying the code, and avoiding any third-party scripts that might slow down the page loading.

Dan from Vevol Media - Shopify Partners Since 2018
--
• Was my reply helpful? Click Like to let me know!
• Was your question answered? Mark it as an Accepted Solution