Hi there,
I’m trying to set up my Meta Pixel to track when someone submits a Klaviyo sign-up form on my shop. I’ve already read all the community topics about this and followed their instructions, but it’s not working.
I’ve added the following code to theme.liquid just about </body> on my Shopify store, but Meta is not tracking form submissions. Am I missing a step? Do I need to add something to Klaviyo itself or to Meta’s ad manager?
<script>
window.addEventListener("klaviyoForms", function(e) {
if (e.detail.type == 'submit') {
<!-- Meta 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',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'ID REMOVED BUT IT WOULD BE HERE');
fbq('track', 'Lead');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=ID REMOVED BUT IT WOULD BE HERE&ev=Lead&noscript=1"
/></noscript>
<!-- End Meta Pixel Code -->
} }); </script>
Thanks for your help!