Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
Hi
I want to add javascript code to one page only in my shopify store
is it possible to do this?
thanks katie
Hi, Katie!
Elle here from Shopify's Social Care team.
In order to add Javascript to a single page, you'll need to create a new page template under Online store > Themes > Actions > Edit Code.
Here's how it will look:
Once you've created the new template, look for the following snippet of code:
<div class="rte">
Paste your Javascript code above this line of code. Make sure to wrap it with <script> </script> tags.
Once you have this done, you can assign the new template to the page you'd like to apply it to here:
Hope this is helpful!
Elle | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Do we have to copy the quick-add.js from the script/global/quick-add.js location to the assets folder?
I also want to add javascript code to an individual page and I tried to follow the instructions above but when I create the new page template, I don't see the piece of code referenced above:
<div class="rte">
I see a different piece of code that looks like this: { % section "page" % }
Can you please advise?
To add JavaScript to an individual or group of Shopify pages:
If you need additional help, check out the step-by-step screenshots on my blog post here.
I did this but I can't see the entire calculator that I'm trying to add?
It's supposed to look like this:
Help?
Is that the only way to add JS code to my shop...?
What would happen if I change the theme, would I have to create a new template again...?
Is there any way to make these steps theme-compatible...? I mean, compatible with any theme whatsoever...
Thanks!
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...
ByYour online store speed can enhance your store’s discoverability, boost conversion rates a...
ByShopping is at our fingertips with mobile devices. Is your theme optimized to be user-frie...
By