JavaScript Snippets
With JavaScript snippets, you can add JS code to your Storefront, such as trackers.
- Open your Instant Commerce store and go to Custom code.
- Click Add JS Snippet.
- The JS custom code editor will open. Write your custom JS code.
- Save your code when you're done.
If you want to change an existing snippet, open your Instant Commerce store, go to Custom code, find the snippet you would like to change, and click Edit.
Publishing your code
After you save your code, you can toggle it from Draft to Published code. You can only set it to Published after you have saved your code first.
Archiving or deleting your code
If you no longer want to use a JS snippet, you can archive or delete it by clicking the dropdown next to Save and selecting Archive or Delete.
Loading priority
Under Settings, you can enable the Loading priority function. Loading priority determines whether or not the script is loaded with priority. It impacts your storefront's performance, but might be required if business logic depends on loading critical data. Keep this in mind when enabling the loading priority.
Bypass cookie integration
Under Settings, you can bypass your third party cookie integration (Cookiebot, OneTrust) to ensure your JS code will not be blocked by this integration.