How to Integrate OptinMonster with Google Tag Manager

Adding OptinMonster to your site is easy, you can even use Google Tag Manager to implement our embed code.

In this article, you’ll learn how to embed OptinMonster on your site using Google Tag Manager.

Before You Start

  • Google Tag Manager is just one option for adding OptinMonster’s embed code to your site. We offer many platform-specific guides to help you get started quickly.

Configure Google Tag Manager

When you create a campaign in OptinMonster you’ll want to embed it on your website.

To embed your campaigns on your website using Google Tag Manager, follow these steps:

  1. Log into Google Tag Manager.
  2. From the Workspace screen, select Add New Tag to create a new Tag.
    Add a new GTM tag
  3. Add a title for your tag.
    Click Title Area to add Tag Title
  4. Next, select the Tag Configuration section to view the Tag Type menu. Scroll down and select Custom HTML.
    Account-wide select Custom HTML as tag type
  5. In a new browser tab, edit the campaign you want to embed and navigate to the Publish view. Choose the Any Website embed option and copy the account-wide embed code provided.
  6. Return to Google Tag Manager and paste the embed code into the Custom HTML field.
    Account-wide+paste embed code in tag
  7. Next, enable the Support document.write option.
    This step is mandatory, your campaign will not function on your site if this option is not enabled!
    Account-wide enable Support Document Write
  8. Expand the Advanced Settings section and select the Tag firing option you wish to use. In this example, we’ll fire the Tag once per page load.
    Account-wide tag set to fire once per page
  9. Select the Triggering section.
    Because you’re using the account-wide embed code we recommend you configure the Tag to fire on All Pages of your site and control where on your site the campaign appears through the campaign builder’s Display Rules.
    Account-wide select all pages for trigger
  10. After you review your setup, click Save on the top right to save your new tag.Account-wide save newly created tag
  11. You’ll now see the Tag you’ve created in the Workspace view of Google Tag Manager.
    Account-wide embed tag added
  12. Once you’ve created your Tag you can either Preview or Submit (Publish) it. To make this campaign live, go ahead and click Submit.
    Account-wide tag submit to publish
    New Tags added will indicate a new version of Google Tags loading on your site. To help track changes, you should add a version name, including what you changed. Specifically, you’ve added the account-wide OptinMonster embed code so you can mention that.
  13. When you’re finished, select Publish.
    Account-wide tag add notes to version and publish

Troubleshooting

My campaign isn’t showing on my site after I’ve embedded it using Google Tag Manager.

Double-check that your Tag in GTM has the support document.write option enabled. This is required:

Account-wide enable Support Document Write