{"id":91616,"date":"2023-03-10T06:48:40","date_gmt":"2023-03-10T11:48:40","guid":{"rendered":"https:\/\/optinmonster.com\/?post_type=optinmonster_docs&#038;p=91616"},"modified":"2025-08-13T06:02:04","modified_gmt":"2025-08-13T10:02:04","slug":"facebook-pixel-optinmonster","status":"publish","type":"optinmonster_docs","link":"https:\/\/optinmonster.com\/docs\/facebook-pixel-optinmonster\/","title":{"rendered":"Using the Meta Pixel with OptinMonster"},"content":{"rendered":"\n<p>OptinMonster makes it easy to integrate the Meta Pixel with your campaigns.<\/p>\n\n\n\n<p>In this article, you&#8217;ll learn how to add Meta&#8217;s Pixel tracking code to your OptinMonster campaigns.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Before You Start<\/h2>\n\n\n\n<p>Here are some things to know before you begin:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Due to the advanced nature of this guide, at this time we do not provide support for Meta Pixel implementation.<\/li>\n\n\n\n<li>The Success Scripts implementation option in this guide requires a <a href=\"https:\/\/optinmonster.com\/pricing\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Growth subscription<\/a>.<\/li>\n\n\n\n<li>This guide provides additional options for implementing the Meta Pixel that are available with all plans.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Meta Pixel Base Code<\/h2>\n\n\n\n<p>Before you can implement the Meta Pixel with your OptinMonster campaigns you&#8217;ll need to add the Base Code to the website where your campaign(s) will appear.<\/p>\n\n\n\n<p>Meta recommends that you add the Base Code for the Meta Pixel to all pages of your site in their <a href=\"https:\/\/developers.facebook.com\/docs\/facebook-pixel\/get-started\" target=\"_blank\" rel=\"noopener nofollow\" title=\"Meta Pixel documentation\">Meta Pixel documentation<\/a>.<\/p>\n\n\n\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-92051\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2015\/12\/facebook-pixel-base-code.jpg\" alt=\"You'll want to add the Facebook Pixel Base Code to all pages of your website according to Facebook's documentation.\" width=\"620\" height=\"444\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2015\/12\/facebook-pixel-base-code.jpg 620w, https:\/\/optinmonster.com\/wp-content\/uploads\/2015\/12\/facebook-pixel-base-code-300x215.jpg 300w\" sizes=\"(max-width: 620px) 100vw, 620px\" \/><br>The <strong>Standard Event<\/strong> code is what will be added to your OptinMonster campaign in the next steps.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Example of Standard Event Code<\/h5>\n\n\n\n<script src=\"https:\/\/library.wpcode.com\/embedjs\/e501ywr2.js\/\"><\/script>\n\n\n\n<p>There are several different approaches you can choose to add the Meta Pixel to your OptinMonster Campaign. We&#8217;ll walk through each option step-by-step.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"options\">Add Pixel via Success Scripts<\/h2>\n\n\n\n<p>If you are using one of our native integrations, the easiest way to <a href=\"https:\/\/optinmonster.com\/docs\/how-to-use-success-triggered-scripts\/\" target=\"_blank\" rel=\"noopener\" title=\"\">implement the Meta Pixel with your OptinMonster campaign(s) is using Success Scripts<\/a>.<\/p>\n\n\n\n<div class=\"alert-box alert-blue\">\n<p class=\"alert-box-title\"><\/p>\n\n\n\n<p>Success Scripts requires a <a href=\"http:\/\/optinmonster.com\/pricing\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Growth subscription<\/a>. If you are using a Custom HTML integration be sure you\u2019ve edited your custom form to <a href=\"https:\/\/optinmonster.com\/docs\/how-to-track-conversions-when-using-a-custom-html-form\/\" target=\"_blank\" rel=\"noopener\" title=\"\">track conversions when submitted<\/a>.<\/p>\n\n\n\n<p class=\"is-style-arrow-link has-link-color\"><\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"options\">Add Pixel via HTML Block<\/h2>\n\n\n\n<p>If you do not have a Growth subscription or would like to trigger the Meta Pixel on a different event than conversion, you can use our Javascript Events API.<\/p>\n\n\n\n<p>Follow these steps to add the Meta Pixel using an HTML Block.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>First, you will need to determine which event your Meta Pixel should be fire on. All OptinMonster events are outlined in our <a href=\"https:\/\/optinmonster.com\/docs\/optinmonster-javascript-events-api\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Javascript Events API<\/a> doc.<\/li>\n\n\n\n<li>Next, add an HTML Block to your campaign by dragging the HTML element to the desired place within campaign.<br><img decoding=\"async\" width=\"800\" height=\"468\" class=\"wp-image-202991\" style=\"width: 800px;\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/htmlBlock.png\" alt=\"\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/htmlBlock.png 2746w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/htmlBlock-300x175.png 300w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/htmlBlock-1024x599.png 1024w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/htmlBlock-768x449.png 768w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/htmlBlock-1536x898.png 1536w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/htmlBlock-2048x1198.png 2048w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>Add your Meta Pixel code to the HTML Block. <img decoding=\"async\" width=\"800\" height=\"497\" class=\"wp-image-202994\" style=\"width: 800px;\" src=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/addHTML-1.png\" alt=\"\" srcset=\"https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/addHTML-1.png 2626w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/addHTML-1-300x186.png 300w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/addHTML-1-1024x636.png 1024w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/addHTML-1-768x477.png 768w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/addHTML-1-1536x953.png 1536w, https:\/\/optinmonster.com\/wp-content\/uploads\/2023\/03\/addHTML-1-2048x1271.png 2048w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/li>\n\n\n\n<li>When you&#8217;re finished, click&nbsp;<strong>Save<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">HTML Block Examples<\/h2>\n\n\n\n<p>The following are some examples you can use to get started triggering your Meta Pixel on different OptinMonster Javascript Events.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Trigger Meta Pixel on Successful Conversion<\/h5>\n\n\n\n<script src=\"https:\/\/library.wpcode.com\/embedjs\/y26zg765.js\/\"><\/script>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Trigger Meta Pixel When Campaign is Closed<\/h5>\n\n\n\n<p>In this example, the <strong>om.Optin.close<\/strong> event will fire only when the campaign is closed.<\/p>\n\n\n\n<script src=\"https:\/\/library.wpcode.com\/embedjs\/qo9z79z2.js\/\"><\/script>\n\n\n\n<h5 class=\"wp-block-heading\">Trigger Meta Pixel When Campaign First Shows<\/h5>\n\n\n\n<p>In this example, the&nbsp;<strong>om.Optin.afterShow<\/strong> event will fire only after the campaign becomes visible.<\/p>\n\n\n\n<script src=\"https:\/\/library.wpcode.com\/embedjs\/m5l7dv92.js\/\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">FAQs<\/h2>\n\n\n\n<h5 class=\"wp-block-heading\">How can I trigger a different Meta Pixel event?<\/h5>\n\n\n\n<p>You may need to customize the specific Standard Event to fit your needs, please refer to this <a href=\"https:\/\/developers.facebook.com\/docs\/facebook-pixel\/implementation\/conversion-tracking#standard-events\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">list of Meta Pixel Standard Events<\/a> for what&#8217;s available.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Do I have to add the code to an HTML Block in the campaign builder?<\/strong><\/h5>\n\n\n\n<p>No, you can use the Success Script option if you have a <a href=\"https:\/\/optinmonster.com\/pricing\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Growth subscription<\/a> or you can add the Javascript directly to your website where the campaign will appear to visitors.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">How can I add JavaScript to my WordPress site?<\/h5>\n\n\n\n<p>See how to <a href=\"https:\/\/optinmonster.com\/docs\/adding-javascript-to-your-wordpress-site\/\" target=\"_blank\" rel=\"noopener\" title=\"\">add JavaScript to your WordPress site by following this guide<\/a>.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>OptinMonster makes it easy to integrate the Meta Pixel with your campaigns. In this article, you&#8217;ll learn how to add Meta&#8217;s Pixel tracking code to your OptinMonster campaigns. Before You Start Here are some things to know before you begin: Meta Pixel Base Code Before you can implement the Meta Pixel with your OptinMonster campaigns&nbsp;&hellip;<\/p>\n","protected":false},"author":7337,"comment_status":"open","ping_status":"closed","template":"","documentation\/categories":[96],"documentation\/tags":[31399,31421,31451,31487,31409,31477,31459,31484,31502,31405,31406],"class_list":["post-91616","optinmonster_docs","type-optinmonster_docs","status-publish","hentry","categories-extending"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/91616","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\/7337"}],"replies":[{"embeddable":true,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/comments?post=91616"}],"version-history":[{"count":24,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/91616\/revisions"}],"predecessor-version":[{"id":202998,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/91616\/revisions\/202998"}],"wp:attachment":[{"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/media?parent=91616"}],"wp:term":[{"taxonomy":"categories","embeddable":true,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/categories?post=91616"},{"taxonomy":"internal_tags","embeddable":true,"href":"https:\/\/optinmonster.com\/wp-json\/wp\/v2\/documentation\/tags?post=91616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}