Tracking Klaviyo Form Submissions as Lead Facebook Events

Jackson_Cunnin2
Shopify Partner
113 0 15

I have the FB pixel installed correctly via Shopify > Preferences and it's tracking my events. However, when using Klaviyo forms I am trying to track form submissions as lead events. As per Klaviyo instructions, I've added a callback to the bottom of my theme.liquid directly above </body>

 

 

<script>
window.addEventListener("klaviyoForms", function(e) {
if (e.detail.type == 'submit') {
fbq(‘track’, ‘Lead’)
}
});
</script>

 

 

 

However, the fbq(‘track’, ‘Lead’) line is throwing this error in the console:  "Uncaught SyntaxError: Invalid or unexpected token" (on page load, not form submit) and the event is not tracking on form submit. 

Any ideas where I've gone wrong and/or how to properly track Klaviyo form submissions as leads in Facebook?

 

 

Reply 1 (1)

BrianG16
Visitor
1 0 1

Hey, @Jackson_Cunnin2 did you ever figure this out? I'm trying to do the same thing and would appreciate any insight/learning you have on correctly implementing this.