Adding Page-Specific Code Using the Global PageName Function
You can write code that will only execute on specific pages of your storefront (for example, product pages only, category pages only, etc.). As always, please archive your theme before making any changes.
After you've written your page-specific code, paste it into the script provided below. Replace <insert-pagename-here> with the page you want your code to run on. Then, put the full script (with your custom code) into your template_xx.html file, where "xx" is the name or ID number of your theme, at Design > File Editor > Shortcuts.
<script>
var Page = PageName() || 'default.asp';
if( Page === '<insert-pagename-here>') {
YOUR SCRIPT GOES HERE
}
</script>