How to Integrate OptinMonster with Drupal 7

OptinMonster works on any website where you can add our embed code, including Drupal 7.

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

Before You Start

Here are some things to know before you begin:

Integrate with Drupal

After you’ve created a campaign in OptinMonster, you’ll want to embed it on your Drupal site.

To add the embed code to your Drupal site, follow these steps:

  1. In the OptinMonster campaign builder, navigate to the Publish view and copy the Global Embed code.
    Copy the embed code for your OptinMonster campaign from the Publish screen of the campaign builder.
  2. Next, log into your Drupal site and navigate to the Structure page from the admin menu.
    You'll need to navigate to the Structure settings of your Drupal site to begin adding OptinMonster.
  3. In the modal window that appears select Blocks.
    You can add your OptinMonster embed code to a block in Drupal.
  4. Next, select Add block.
    From the Blocks modal view you'll need to select Add Block to add a new OptinMonster embed to your site.
  5. Complete the following steps when adding your block:
    1. Enter a Block description to easily identify from the admin.
    2. Paste the OptinMonster embed code you copied earlier into the Block body field.
    3. Select Full HTML from the text format dropdown.
    4. In the Region Settings section, you’ll want to add your block to the footer of your site by selecting that option from the theme dropdown.
    5. (Optional) You can control the Visibility of your campaign based on page, content type, and even user.
    6. When you’re finished, click Save block.
      When adding your Drupal block, there are specific settings you'll want to set when embedding OptinMonster.
      You can control the visibility of your optin when creating your Drupal Block.
  6. Once the block is saved and you return to the list of Blocks, scroll down to the Footer section and locate your new block. If you need to modify any settings in the future you can do so by selecting the Configure link.
    You can locate your saved block under the Footer section and modify it's settings later.


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.
    Add site to the Publish screen for your OptinMonster campaign.
  2. When you’re finished, click Save.