Skip to content

Instantly share code, notes, and snippets.

@chrisgalard
Created April 15, 2019 09:38
Show Gist options
  • Save chrisgalard/fa0f259b540b35b2a69ab6ebcdc60e47 to your computer and use it in GitHub Desktop.
Save chrisgalard/fa0f259b540b35b2a69ab6ebcdc60e47 to your computer and use it in GitHub Desktop.
Tracking Facebook Events In Clickfunnels THE RIGHT WAY
<!--
This is a series of code snippets that you can use in order to track your
Facebook pixel data and events effectively in your Clickfunnels pages.
-->
<!-- Use this to track your pixel events when people go to the second step of a 2-step form -->
<script>
var submitBtn = document.querySelector('[href="#submit-form-2step"]'),
secondStep = document.querySelector('.o2step_step2'),
submitBtn.addEventListener('click', function (e) {
setTimeout(function () {
if (secondStep.style.display != 'none') {
// Your event here. For example:
fbq('track', 'Lead');
}
}, 0);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment