Global expansion, localizing content, and selling in multiple currencies and languages
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 "
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
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024