Add JavaScript through the Admin UI
JavaScript can be added on a page by page basis through the Admin UI. To do so, visit a content edit page in the Admin, such as the home page edit screen.
Hover over the Content card and click the "Manage Content" button.
Click the "Advanced" link at the top of the Content Editor UI.
Here you are able to append JavaScript to either the head
or body
elements via the Content Appended to Head Element or JavaScript Appended to Body Element fields, respectively. The former field allows content other than JavaScript, so be sure to wrap your JavaScript in a <script>
tag. The latter field only accepts JavaScript, so you should omit the <script>
tag.
Visit the home page in the Storefront and behold! JavaScript!
Help Us Improve this Doc
Was this helpful? Open a GitHub issue to report a problem with this doc, suggest an improvement, or otherwise provide feedback. Thanks!