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

Yes, you can. You’ll need the follwing code for that:

 

$(function () {
  $('.OM-conversion-action').on('click', function () {
    if (!OptiMonk.validate($('.OM-form'))) {
        return;
    }

    OptiMonk.executeOnSite(
        function() {
            !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', "Lead");
        },

        function() {}
    );
  });
});

 

 

You need to replace it with the FB pixel code used by you, but the script and the noscript tags must be removed.

You can also put any other tracking codes to the place of the FB pixel code. In this case this will be run in case of a conversion.

To make this code work, please insert it to the JS editor of the popup.

Have more questions? Submit a request

Comments

Powered by Zendesk