Skip to main content

Can I use any kind of tracking codes in the popup (for instance, Facebook pixel)?

Updated over 5 months ago

Yes. You can embed tracking codes—such as the Facebook Pixel—into your OptiMonk popup.

Example: Facebook Pixel Code

Below is an example snippet you can adapt:

!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1719342018283696');
fbq('track', 'Subscribe');

Important

  • Replace the sample Pixel ID (1719342018283696) with your own.

  • Remove any <script> or <noscript> tags before pasting into OptiMonk.

  • You may insert other tracking codes in place of the Facebook Pixel—this field supports any custom script.


How to Add a Tracking Code to Your Popup

Step 1: Log In

Log in to your OptiMonk account at:
https://app.optimonk.com/login/en

Step 2: Select Your Campaign

  1. Click Campaigns in the left-hand menu.

  2. Choose the campaign in which you want to implement the tracking script.

Step 3: Open the Campaign Variant

Click the Campaign Variant you want to edit. This will open the Campaign Editor.


​Step 4: Navigate to the JavaScript Editor

Select Code on the left.


Switch to the JS editor.

  1. Ensure that the JS event is set to Popup fill.

  2. Paste your tracking code into the editor.


Step 5: Save Your Changes

Click Save, then Save & Exit in the top-right corner.


Need Help?

If you need assistance adding your tracking code or troubleshooting the integration, contact us at [email protected], or start a live chat, and our team will be happy to help you.

Did this answer your question?