I’m using a popup on an existing html page (not built/served by unbounce), and would like to fire a FB event (“CompleteRegistration” event) when someone clicks on a button in the popup form.
Problem is that when I add javascript to the popup that just fires the CompleteRegistration event… FB Pixel Helper doesn’t see the CompleteRegistration even, and I’m seeing this error in the chrome inspector console:
“Uncaught ReferenceError: fbq is not defined”
This is the javascript I have in the popup builder:
<script>
$(document).ready(function () {
$('#lp-pom-button-22').click(function() {
fbq('track', 'CompleteRegistration', {
value: 1.00,
currency: 'USD'
});
})
});
</script>
Based on @Jonathan’s answer here (Issue with Facebook pixel), my theory is that I need to fire the base code from within unbounce as well.
But I’m worried about firing the FB base code twice — once from the html page’s section, and once from the unbounce popup.
Questions:
-
Do I need to fire the FB pixel’s “base code” from within unbounce too? Is this how to get the CompleteRegistration event to fire properly upon action (button click) on the unbounce popup?
-
Will it conflict with the FB pixel base code that is already being fired in the existing html page’s section?
Thanks in advance!