Hey all -
Hoping to get some help with troubleshooting adding an event listener for a button click on my site so I can track using Facebook Pixels. I’ve tried everything I can according to Facebook Pixel | Webflow University and Redirecting... and ran into a wall. I’m using Facebook events manager to troubleshoot and the event just doesn’t seem to be firing.
Here’s the button-specific code (I also named the button as “getStarted”):
<!-- Add Pixel Events to the button's click handler -->
<script type="text/javascript">
var button = document.getElementById('getStarted');
button.addEventListener(
'click',
function() {
fbq('track', 'Lead', {
content_name: 'Get Started with Concierge',
content_category: 'Concierge Home Page',
content_ids: ['1234'],
content_type: 'concierge product',
value: 5,
currency: 'USD'
});
},
false
);
</script>
Here is my site Read-Only: Webflow - Sunday Health Website
(how to share your site Read-Only link)