How to Embed Your Campaigns On Your Site

OptinMonster makes it easy to add your campaigns to your site by giving you flexibility.

In this article, you’ll learn how to embed your OptinMonster campaigns on your site.

Before You Start

Here are some things to know before you begin:

Embed Campaigns

To embed your campaigns, follow these steps:

  1. Navigate to the Publish view in the campaign builder.
    Publish tab in the OptinMonster campiagn builder shows the campaign's current publish status.
  2. Under the Platform section, you’ll find multiple embed options:
    Publish screen platform options for embedding your OptinMonster campaign.

    1. Any Site
      • Global Embed — This is a single Account-wide Embed code for all your sites, it allows all Published popup campaigns to appear on your site without further action necessary.
      • Campaign Embed — The embed code that controls only this specific campaign and does not affect any other campaigns.
    2. WordPress
    3. Shopify
    4. WooCommerce
    5. BigCommerce
    6. Share — This will provide you with the shareable MonsterLink for your campaign.
    7. Click to Load — If the MonsterLink rule is enabled in the Display Rules for this campaign you’ll find the MonsterLink provided here.
  3. Once you’ve copied the appropriate embed code you’re ready to paste it into your site. We recommend adding it just before the closing </body> tag in the page code.
    Recommended: See our platform specific guides as well as our general guide to load OptinMonster on any website for more specific instructions.

Publish Campaign

Once you’ve embedded OptinMonster on your site, you’ll want to publish your campaign so it can appear to visitors.

To publish your campaign, follow these steps:

  1. Navigate to the Publish view in the campaign builder.
    Publish tab in the OptinMonster campiagn builder shows the campaign's current publish status.
  2. Next, under the Publish Status section select the Publish button.
    Publish Status in the OptinMonster campaign builder.
  3. Once your campaign is Published you’ll see this status reflected in the top menu bar.
    The publish status will appear in the top navigation menu of the campaign builder.
  4. When you’re finished, click Save.
  5. (Optional) To pause your campaign you can always change the status back to Draft from the Publish screen.

Troubleshooting

What domain do I enter when creating my campaign?

You’ll want to add the domain that appears in the address bar when you view your website.

If you haven’t registered the domain you want to use in your OptinMonster account yet, you can add the site through the Publish screen in the campaign builder, or through the Account > Sites screen. Learn more about how to register your domain in OptinMonster.

  1. In the Publish view of the campaign builder, be sure the domain is listed under the Websites section. Click Add a website if your domain isn’t already assigned to the campaign to select and add it.
  2. When you’re finished, click Save.
What’s the difference between the Account-wide and Campaign Specific embed codes?

You may find a specific purpose for each version of embed code to best fit your workflow:

Global Embed: The Global Embed code only needs to be added once to allow all campaigns that are configured to load on the specific domain to appear. This embed code can save significant time as there is no need to update it when you want to replace or remove a campaign. Simply Draft or Delete the campaign within your OptinMonster account and that change will be immediately reflected on your website.

Campaign Embed: The Campaign Embed code is unique to the individual campaign and must be added everywhere you want that campaign to appear. If you wish to embed multiple campaigns across your site and are using the Campaign Embed you will need to add the unique embed code for each campaign where you want that campaign to load. If you want to replace or remove a campaign you must manually edit the embed code present on your site.

I’m using the Global Embed, how do I control where my campaign can appear?

You will want to use the Display Rules in the campaign builder to configure where and how your campaign loads.

I’m using the Global Embed but my Inline campaign isn’t appearing.

With the Global Embed option it’s necessary to add the HTML placeholder code within the page content where you want your Inline campaign to visually appear.

You can find the HTML placeholder code on the Publish screen above the Global Embed code for your individual Inline campaigns.

Inline Embed Code

Does the embed code have to be pasted before the closing body tag?

No, you can add the embed code anywhere within the body of your site, however, there is no reason to add the campaign further up the page for popup type campaigns. Since the campaign doesn’t load until the rest of your site has loaded we recommend adding the embed code for any popup type campaign just before the closing </body> tag.