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
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.
User | Count |
---|---|
23 | |
19 | |
13 | |
12 | |
11 |