{"id":89796,"date":"2021-10-21T16:37:02","date_gmt":"2021-10-21T20:37:02","guid":{"rendered":"https:\/\/optinmonster.com\/?post_type=optinmonster_docs&#038;p=89796"},"modified":"2025-08-01T11:04:16","modified_gmt":"2025-08-01T15:04:16","slug":"how-to-integrate-optinmonster-with-google-tag-manager","status":"publish","type":"optinmonster_docs","link":"https:\/\/optinmonster.com\/docs\/how-to-integrate-optinmonster-with-google-tag-manager\/","title":{"rendered":"How to Integrate OptinMonster with Google Tag Manager"},"content":{"rendered":"\n<p>Adding OptinMonster to your site is easy, you can even use <a href=\"https:\/\/www.google.com\/analytics\/tag-manager\/\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\">Google Tag Manager<\/a> to implement our embed code.<\/p>\n\n\n\n<p>In this article, you&#8217;ll learn how to embed OptinMonster on your site using Google Tag Manager.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Before You Start<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Google Tag Manager is just one option for adding OptinMonster&#8217;s embed code to your site. We offer many <a href=\"https:\/\/optinmonster.com\/categories\/docs\/platforms\/\" target=\"_blank\" rel=\"noopener\" title=\"\">platform-specific guides<\/a> to help you get started quickly.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Configure Google Tag Manager<\/h2>\n\n\n\n<p>When you&nbsp;<a href=\"https:\/\/optinmonster.com\/docs\/creating-your-first-optin\/\" target=\"_blank\" rel=\"noopener\" title=\"\">create a campaign<\/a> in OptinMonster you&#8217;ll want to embed it on your website.<\/p>\n\n\n\n<p>To embed your campaigns on your website using Google Tag Manager, follow these steps:<br><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/NkopeS-rbAA?rel=0\" width=\"800\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log into <a href=\"https:\/\/www.google.com\/analytics\/tag-manager\/\" target=\"_blank\" rel=\"noopener nofollow\" title=\"\">Google Tag Manager<\/a>.<\/li>\n\n\n\n<li>From the Workspace screen, select<strong><i> <\/i>Add New Tag<\/strong>&nbsp;to create a new Tag.<br><img decoding=\"async\" width=\"800\" height=\"344\" class=\"wp-image-120377 size-full alignnone\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Add-a-new-GTM-tag-e1527174891736.png\" alt=\"Add a new GTM tag\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Add-a-new-GTM-tag-e1527174891736.png 800w, https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Add-a-new-GTM-tag-e1527174891736-300x129.png 300w, https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Add-a-new-GTM-tag-e1527174891736-768x330.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>Add a title for your tag.<br><img decoding=\"async\" width=\"800\" height=\"350\" class=\"size-full wp-image-120378 alignnone\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Click-Title-Area-to-add-Tag-Title.png\" alt=\"Click Title Area to add Tag Title\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Click-Title-Area-to-add-Tag-Title.png 800w, https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Click-Title-Area-to-add-Tag-Title-300x131.png 300w, https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Click-Title-Area-to-add-Tag-Title-768x336.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>Next, select the <strong>Tag Configuration<\/strong> section to view the <strong>Tag Type<\/strong> menu. Scroll down and select&nbsp;<strong>Custom HTML<\/strong>.<br><img decoding=\"async\" width=\"800\" height=\"349\" class=\"size-full wp-image-120371 alignnone\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-select-Custom-HTML-as-tag-type.png\" alt=\"Account-wide select Custom HTML as tag type\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-select-Custom-HTML-as-tag-type.png 800w, https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-select-Custom-HTML-as-tag-type-300x131.png 300w, https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-select-Custom-HTML-as-tag-type-768x335.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>In a new browser tab, edit the campaign you want to embed and navigate to the&nbsp;<strong>Publish<\/strong> view. Choose the&nbsp;<strong>Any Website<\/strong> embed option and copy the account-wide embed code provided.<br><img decoding=\"async\" width=\"800\" height=\"510\" class=\"alignnone size-full wp-image-165653\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/global-embed-code.jpg\" alt=\"Global embed code for OptinMonster can be found in the Publish screen of the campaign builder.\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/global-embed-code.jpg 800w, https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/global-embed-code-300x191.jpg 300w, https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/global-embed-code-768x490.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>Return to Google Tag Manager and paste the embed code into the <strong>Custom&nbsp;HTML<\/strong> field.<br><img decoding=\"async\" width=\"800\" height=\"661\" class=\"alignnone size-full wp-image-165648\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-OM-embed-code.jpg\" alt=\"Add the OptinMonster Embed Code to your Tag in Google Tag Manager.\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-OM-embed-code.jpg 800w, https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-OM-embed-code-300x248.jpg 300w, https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-OM-embed-code-768x635.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>Expand the <strong>Advanced Settings<\/strong> section and select the <strong>Tag firing option<\/strong> you wish to use. In this example, we&#8217;ll fire the Tag <strong>once per page<\/strong> load.<br><img decoding=\"async\" width=\"800\" height=\"1183\" class=\"alignnone size-full wp-image-165649\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-onceperpage.jpg\" alt=\"Fire tag in Google Tag Manager once per page.\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-onceperpage.jpg 800w, https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-onceperpage-203x300.jpg 203w, https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-onceperpage-692x1024.jpg 692w, https:\/\/optinmonster.com\/wp-content\/uploads\/2021\/10\/google-tag-manager-onceperpage-768x1136.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>Select the <strong>Triggering<\/strong> section.<\/li>\n<\/ol>\n\n\n\n<div class=\"alert-box alert-blue\">\n<p class=\"alert-box-title\"><\/p>\n\n\n\n<p>Because you&#8217;re using the account-wide embed code we recommend you configure the Tag to fire on <strong>All Pages<\/strong> of your site and control where on your site the campaign appears through the campaign builder&#8217;s Display Rules.<\/p>\n\n\n\n<p class=\"is-style-arrow-link has-link-color\"><\/p>\n<\/div>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"800\" height=\"350\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-select-all-pages-for-trigger.png\" alt=\"Account-wide select all pages for trigger\" class=\"wp-image-120370\" style=\"object-fit:cover\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-select-all-pages-for-trigger.png 800w, https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-select-all-pages-for-trigger-300x131.png 300w, https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-select-all-pages-for-trigger-768x336.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<ol start=\"9\" class=\"wp-block-list\">\n<li>After you review your setup, click <strong>Save<\/strong> on the top right to save your new tag.<img decoding=\"async\" width=\"800\" height=\"351\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-save-newly-created-tag.png\" alt=\"Account-wide save newly created tag\"><\/li>\n\n\n\n<li>You&#8217;ll now see the Tag you&#8217;ve created in the Workspace view of Google Tag Manager.<br><img decoding=\"async\" width=\"800\" height=\"350\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-embed-tag-added.png\" alt=\"Account-wide embed tag added\"><\/li>\n\n\n\n<li>Once you&#8217;ve created your Tag you can either Preview or Submit (Publish) it. To make this campaign live, go ahead and click&nbsp;<strong>Submit<\/strong>.<br><img decoding=\"async\" width=\"800\" height=\"350\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-tag-submit-to-publish.png\" alt=\"Account-wide tag submit to publish\"><br>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&#8217;ve added the account-wide OptinMonster embed code so you can mention that.<\/li>\n\n\n\n<li>When you&#8217;re finished, select&nbsp;<strong>Publish<\/strong>.<br><img decoding=\"async\" width=\"800\" height=\"351\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2018\/05\/Account-wide-tag-add-notes-to-version-and-publish.png\" alt=\"Account-wide tag add notes to version and publish\"><\/li>\n<\/ol>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<h5 class=\"wp-block-heading\">I&#8217;ve added the OptinMonster embed code using Google Tag Manager but my site still shows as &#8220;Not Connected&#8221;.<\/h5>\n\n\n\n<p>Due to how Google Tag Manager includes our script you may need to manually verify the site.<\/p>\n\n\n\n<p>To do this, add <code>?om-verify-site=true<\/code> to the end of the URL to a specific page containing our embed code and you should see a green &#8220;Verified&#8221; badge appear for a moment in the lower left-hand corner of the browser window.<\/p>\n\n\n\n<p>For example: <code>https:\/\/optinmonster.com<strong>?om-verify-site=true<\/strong><\/code><\/p>\n\n\n\n<p>Your site should then show as &#8220;Connected&#8221;.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Why is my campaign not showing in Safari&#8217;s private browsing mode?<\/h5>\n\n\n\n<p>If your campaign is not showing in Safari\u2019s private browsing mode and your site has the OptinMonster embed code loaded via <a href=\"https:\/\/optinmonster.com\/docs\/how-to-integrate-optinmonster-with-google-tag-manager\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Google Tag Manager<\/a> (GTM), it is likely due to Apple\u2019s new <strong>Advanced Tracking and Fingerprinting Protection<\/strong>, which is enabled by default in Safari\u2019s private browsing mode on <strong>iOS 17<\/strong>.<\/p>\n\n\n\n<p>This protection appears to block Google Tag Manager, preventing the OptinMonster embed script from loading and causing campaigns to fail to display. You can <strong>Reduce Protections<\/strong> in a private browsing tab, and your OptinMonster campaigns should appear as Google Tag Manager is unblocked.<\/p>\n\n\n\n<p>To avoid this issue, we recommend <a href=\"https:\/\/optinmonster.com\/docs\/how-to-add-optinmonster-to-any-website\/\" target=\"_blank\" rel=\"noreferrer noopener\">adding your OptinMonster global embed code directly to your site<\/a>. This approach bypasses Safari\u2019s privacy restrictions entirely and ensures campaigns will load, even when the default protections are enabled.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding OptinMonster to your site is easy, you can even use Google Tag Manager to implement our embed code. In this article, you&#8217;ll learn how to embed OptinMonster on your site using Google Tag Manager. Before You Start Configure Google Tag Manager When you&nbsp;create a campaign in OptinMonster you&#8217;ll want to embed it on your&nbsp;&hellip;<\/p>\n","protected":false},"author":4657,"comment_status":"open","ping_status":"closed","template":"","documentation\/categories":[210],"documentation\/tags":[31399,31430,31424,31411,31401,31418],"class_list":["post-89796","optinmonster_docs","type-optinmonster_docs","status-publish","hentry","categories-platforms"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/89796","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/types\/optinmonster_docs"}],"author":[{"embeddable":true,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/users\/4657"}],"replies":[{"embeddable":true,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/comments?post=89796"}],"version-history":[{"count":17,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/89796\/revisions"}],"predecessor-version":[{"id":206024,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/89796\/revisions\/206024"}],"wp:attachment":[{"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/media?parent=89796"}],"wp:term":[{"taxonomy":"categories","embeddable":true,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/categories?post=89796"},{"taxonomy":"internal_tags","embeddable":true,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/tags?post=89796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}