How do I add the snippet script to my WordPress website?

In this video, we’ll show you how to add your snippet script to your WordPress site.

Where to find your GetEmails collection snippet script

1. From your GetEmails Dashboard, click Code Script in the left navigation. Then, click View Script next to the domain you want to add the snippet script to.

2. Check the box next to Collection, and then click Copy Code </>.

How to add collection snippet script

There are two options for adding the script to your WordPress site. You can use a free plugin or add directly to the code. We recommend using the plugin if you can.

Add Script Using a Free Plugin

1. From your WordPress Dashboard, click Plugins on the left navigation, then click Add New.

2. On the top right, where it says Search Plugins, search for “Header and Footer Scripts.”

This is the plugin you are searching for: https://wordpress.org/plugins/header-and-footer-scripts/

3. Click Install Now. 

4. Once the plugin is installed, press Activate.

5. Return to your WordPress dashboard and click Pages on the left navigation. Click to edit the page you would like to add the GetEmails script to. The Header and Footer Scripts plugin will have added a box at for you to insert the tracking script. Paste the script into this box. Make sure to press the Save/Update/Publish button in the top right of the page to save the update.

6. If this plugin doesn’t work for you, try the “Header Footer Code Manager” plugin.

7. From your GetEmails dashboard, click On next to Script Status to turn your script on.

Add Script Directly to Code

1. Click on Appearance → Theme Editor

2. Click on header.php on the right to access the header file:

3. The header section is between <head> and </head>. Paste the script in this section.

4. Click on Update Files button to save your changes.

5.  From your WordPress Plugins, find your Cache plugin and navigate to Settings. For your plugin, find where you can clear any/all caches. For WP Rocket, this is seen here:

6. Additionally, if you are using a CDN, you should make sure that you exclude the GetEmails URL from it. In WP Rocket, this can be done under the CDN menu. Add /ge.js in the exclude field, and Save:

7. From your GetEmails dashboard, click On next to Script Status to turn your script on.

How to add suppression snippet script

The suppression script can be added to your website on any pages that you do NOT want GetEmails to collect email addresses. Generally speaking, you would put this script on landing pages where the person has already converted, and therefore, you have already collected their email address.

Examples of pages you’d want to add the suppression script to are post-checkout, thank you, and confirmation pages.

1. From your GetEmails Dashboard, click Code Script in the left navigation and then </> below View Script. Then, check the box next to Suppression, and click Copy Code.

2. After you’ve installed the plugin following the steps above (Add Script Using a Free Plugin), click Pages on the left navigation from your WordPress dashboard. Then, click to edit the page you would like to add the GetEmails suppression script to.

3. The Header and Footer Scripts plugin will have added a box at the top of the page for you to insert the tracking script. Paste the suppression script into this box. Make sure to press the Save/Update/Publish button in the top right of the page to save the update.

4. From your GetEmails dashboard, click On next to Script Status to turn your script on.

How to test your script to confirm it’s working

Click here to learn how to test your script.