Have a Drupal 8 website you want to add OptinMonster too? We make it simple with our embed codes! This doc will show you how integrate OptinMonster into your Drupal 8 website.
Step 1 – Create and Publish a Campaign
The first step is to create a campaign and retrieve it’s embed code. See this guide on how to embed your campaigns on your site for a step-by-step walkthrough if you need assistance.
Step 2 – Paste the Embed Code into a Custom Block in Your Drupal Site
Login to the admin of your Drupal site and select the Structure link from the admin menu.
Next, click Block Layout.
Click Custom Block Library.
Click the blue button Add custom block.
On the Add Custom Block screen you’ll complete the following steps:
- Enter a Block description to easily identify this campaign’s block in Drupal.
- Select Full HTML from the text format dropdown.
- Select the Source icon in the Body toolbar.
Now you can paste your OptinMonster embed into the body of your custom block.
Please be careful to follow the steps above in order. If you paste the embed code BEFORE changing the Text Format or without choosing Source, the script itself will display on your live site.
After saving, you’ll be returned to the list view of the Custom Block Library.
Click the Block Layout tab to return to the area where you’ll place your block in the footer region.
Once there, locate a Footer region. If your theme has several footer regions, you can choose any of them.
Click the grey button Place Block.
Click the grey Place Block button next to the Custom Block you previously created.
Configure your custom block by adding a title. Uncheck the box to display the title.
Save your block.
Looking to increase conversions on your new campaign? Check out our list of A/B tests to run on your popups to get more email subscribers.
Q: I have questions about how the Embed Code works.
A: If you have any questions, such as:
- What domain do I enter when creating my campaign?
- What’s the difference between the Account-wide and Campaign Specific embed codes?
- I’m using the Account-wide Embed, how do I control where my campaigns load?
- I’m using the Account-wide Embed, how do I control where on the page my After Post / Inline or Sidebar campaigns appear?
- Does the embed code have to be pasted before the closing
- How do Afterpost and Inline Campaigns work with Embed Codes?
All of the questions above are answered on our main Embed Documentation available here.