Problem with "additional scripts" on checkout

Nick_H
Shopify Partner
1 0 1

I tried to add javascript to my checkout page in the "additional scripts" field, but it wouldn't work. Even 

console.log("Hello world");

wouldn't do anything. Anyone have any idea what the problem is?

jimjams
Tourist
5 0 1

Hey Nick, did you ever get this to work? I'm having the same problem. I've heard some say the Additional Scripts box only works for Shopify Plus users. If that's the case then Shopify:  please remove the box from the admin settings.

0 Likes
AvidBrio
Shopify Expert
158 8 14

@jimjams  @Nick_H    Shopify checkout additional script doesn't allow custom script 


you can see Official document  here- what you can do with addition script  https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/order-status-javasc...

If you find our comment helpful, hit the like button and accept it as a solution.
Want us to implement custom changes in your store? Contact us
Email me directly - jim@avidbrio.com
gina-gregory
Shopify Expert
710 48 176

You can add custom javascript to the "Additional scripts" box. You don't have to be on Plus. What you're missing is a <script> tag. The Additional scripts field takes HTML/Liquid, not just javascript, so you have to wrap your javascript in a <script> tag.

0 Likes
AvidBrio
Shopify Expert
158 8 14

@gina-gregory  did try to  
<script> alert("Hello! I am an alert box!!");</script>

???

If you find our comment helpful, hit the like button and accept it as a solution.
Want us to implement custom changes in your store? Contact us
Email me directly - jim@avidbrio.com
0 Likes
gina-gregory
Shopify Expert
710 48 176

It works, but it's important to point out that the code in the "Additional scripts" field only gets added to the checkout thank you page. It's mostly intended to be a place to add conversion tracking code or a short bit of custom HTML/messaging.

Mistborn
Tourist
4 0 1

@gina-gregory Thank you for this info, it isn't very clear on the literature that it only gets added to the thank you page.

Saved me more time debugging!