Code Snippets

Merchant’s Code Snippets module allows you to add custom JavaScript code to your global header, body, or footer without having to edit your theme’s functions.php file.

Note that this is a developer feature — only add custom code snippets if you have coding knowledge.

Below, you can learn how to configure and activate the module.

1. Open the Code Snippets Module

Open your Merchant dashboard by clicking the Merchant menu in the left sidebar of your WordPress admin area.

Under the Improve Experience heading, click the Code Snippets module to open its settings page:

Location of the Code Snippets module on the Merchant dashboard, annotated screenshot

2. Add the Code Snippets

On the module’s Settings page, you’ll find three fields where you can add your custom code snippets:

  • Header – These scripts will be added to the <head> section of the HTML page.
  • Body – These scripts will be added just below the opening <body> tag.
  • Footer – These scripts will be added just above the closing </body> tag.

Note that right now, you can only add JavaScript code (the code snippets will automatically be wrapped with <script></script> tags). However, we plan to support CSS in the future as well.

Code Snippets module page, settings, screenshot

Once the code snippets are added, click the Save button in the top-right corner of the page.

3. Enable the Code Snippets Module

If everything looks OK, click the Enable button to activate the module:

Merchant's Code Snippets module, Enable button, screenshot