How to Integrate OptinMonster with WordPress

OptinMonster can work with any website including WordPress.

In this article, you’ll learn how to integrate OptinMonster with WordPress.

Before You Start

Here are some things to know before you begin:

  • Anytime you add or delete a campaign in your OptinMonster account, including split-tests, be sure to select the Refresh Campaigns button in the OptinMonster plugin to sync your campaigns.

Connect OptinMonster

To connect OptinMonster to your WordPress site, follow these steps:

  1. Install and activate the OptinMonster API plugin on your WordPress site.
  2. Once the plugin is installed and activated, and you’ve connected to your OptinMonster account you can manage your campaigns.
    Navigate to the WordPress Admin > OptinMonster > Campaigns tab view and select the Refresh Campaigns button to sync the campaigns from your OptinMonster account with the plugin.
    Refresh Campaigns
  3. Next, select the Go Live link below the title of the specific campaign you wish to enable on your site. The status of your campaign will be displayed to the right of the campaign title.
    Go Live
  4. If you stop here, your campaign’s embed code will be output throughout your entire site. You can then control where each campaign has permission to load using the Display Rules in the campaign builder.
  5. (Optional) Customize where the campaign’s embed code is added to your site using the Output Settings in the plugin by selecting the Edit Output Settings link for that campaign.
    Edit Output Settings

Output Settings

Page-Level Targeting with the Output Settings (optional)

For most users, we recommend NOT using the Output Settings to control where your campaign appears and instead use the Display Rules in the campaign builder.

  1. First, login to the WordPress admin of your website.
  2. Next, navigate to the OptinMonster » Campaigns tab view and select the Edit Output Settings link for the campaign you wish to configure.Click Edit Output Settings
  3. Within the Output Settings screen, the following options are available for all campaign types.
    Output Settings Overview
  • Enable campaign on site?
    • The campaign will not be displayed on this site unless this setting is checked.
  • Who should see this campaign?
    • Determines who should be able to view this campaign. Want to hide for newsletter subscribers? Click here to learn how.
    • Options: show campaign to all visitors and users, show campaign to only visitors (not logged-in), or show campaign to only users (logged-in).
  • Advanced Settings
    • More specific settings available for campaign visibility
    • Options:
      • Never load campaign on: Never loads the campaign on the selected posts and/or pages.
      • Load campaign exclusively on: Loads the campaign only on the selected posts and/or pages.
      • Load campaign on post categories
      • Load campaign on post types and archives

Troubleshooting

My campaign isn’t appearing as expected

If you’re using the Advanced Page Targeting options, be sure to check that they do not conflict with any rules you’ve added in the Display Rules area of the campaign builder.

Remember, the OptinMonster plugin controls where the embed code is added to your site while the Display Rules control where the campaign is allowed to appear if the embed code is present.

It is possible to configure these two options in a way that they prevent the campaign from appearing where you wish.

What is the difference between the WordPress Plugin and Display Rules in the campaign builder?

With WordPress’s usage of Categories and Tags (which may not be reflected in each page’s URL), OptinMonster has created a WordPress Plugin that gives Advanced Page Targeting features, such as targeting categories, tags, logged-in users, and more.

What is the WordPress plugin’s Advanced Page Targeting feature?

The WordPress Plugin’s Advanced Page Targeting feature allows you to more specifically target where the OptinMonster embed code is added to your site. It is not necessary to target your campaigns using this approach. For most users, we recommend NOT using this feature, and instead, control where your campaigns appear with the Display Rules in the campaign builder.

What is the Suggested Setup for Most WordPress Users?

Unless you have a specific need to target a category, tag, etc., then most users benefit by using our default setup, which is to Enable your campaign in the plugin, which supplies that specific’s campaign’s embed code globally (i.e.: supplies the embed code to every page of your site.)

It is suggested you use the following WordPress settings (especially if you’re running into any issues of getting your campaign to appear on your WordPress site):

  1. Go to your WordPress Dashboard
  2. Go to OptinMonster Menu
  3. Confirm you are running the latest version of OptinMonster API Plugin (Version 1.3.4 at the time of this writing) If not, update your plugin.
  4. Go to our OptinMonster menu Campaigns tab.
  5. Click Refresh Campaigns. This refreshes your list. This needs to be done anytime you create or delete a campaign on app.optinmonster.com
  6. Go to your Output Settings for each of your campaigns. Have your settings be Enabled and make sure all other options are unchecked, including if you had options checked in the Advanced Settings area. Click Save before leaving the page.
  7. Clear out any site caching that you have.
  8. Then, go back to OptinMonster Menu -> Campaigns. Click the button that says Clear Local Cookies. (Clear Local Cookies will clear all of OptinMonster’s cookies only on your web browser.)
When to Use the Advanced Settings of the WordPress Plugin?

When you have a need to supply the embed code only on specific sections of your WordPress site, such as based on tags, categories, post type, etc., then you would want to use the Advanced Settings.

WooCommerce Pages

You can now also target Specific WooCommerce Pages, Categories and more via the OptinMonster plugin.

WooCommerce Settings Overview

Depending on your setup with Woocommerce, your options shown may vary.

What domain do I enter when creating my campaign?

When creating your campaign you will want to use the domain of the site where you want your campaign to appear. Campaigns will only show on the domains they are assigned to. You can see more about this in our site settings guide.

I don’t see the option to install the OptinMonster API plugin on my WordPress.com site, why?

Unfortunately, it’s not possible to use OptinMonster on WordPress.com sites at this time. All OptinMonster documentation for WordPress is for websites using the self-hosted version of WordPress.

Can I manually place my inline type campaigns?

Yes! See our guide on how to manually add an Inline campaign

Do I need to use both the WordPress Plugin and the Display Rules? Can I use the Display Rules and the Output Setting’s Advanced Settings together?

Yes, these can be used in conjunction.

If you plan to use both be aware of the following priority:

  1. Output Settings — The Output Settings control where the embed code for an individual campaign is placed throughout your site. If the embed code is not present on a specific page the campaign cannot load regardless of the Display Rules configured in the campaign builder.
  2. Display Rules Configuration — The Display Rules configured in the campaign builder control where the campaign has permission to appear to visitors. The Display Rules only come into effect if the specific page contains the embed code for your campaign.