New facebook conversion pixel on one page site (exclude audience)

858 Views Asked by At

complicated situation, i'll try to be as clear as possible.

I have a one page site with a contact form, index.html.

The page has the following remarketing facebook pixel:

<!-- Facebook Pixel Code -->
<script>
!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','//connect.facebook.net/en_US/fbevents.js');

fbq('init', '123456789');
fbq('track', "PageView");</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=123456789&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

When a user submit the form, and i get a response from the ajax, I load an external html file to an iframe on my page (conv.html). that external html file has a conversion code in it:

<!-- Facebook Pixel Code -->
<script>
!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','//connect.facebook.net/en_US/fbevents.js');

fbq('init', '123456789');
fbq('track', "PageView");
fbq('track', 'Lead');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=123456789&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

which is basically the same, only with a 'Lead' track event. as you can see im using 'PageView' on both pixels in order to exclude by the url audience who has submited the form (i need that in addition to the lead event), the thing is, that when i load the second pixel, i get an error saying that the pixel was fired more than once.

im not sure if that any matters, but we have also applied a rule to the second pixel to fire only on page url that contains 'conv.html' (the page that is loaded to my iframe).

i have been look around on google for a solution, but couldnt find anything. im trying to figure out if thats even possible on a one page site.

any ideas?

0

There are 0 best solutions below