Skip to content

Instantly share code, notes, and snippets.

@ovlb
Last active December 22, 2017 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ovlb/790059a73c5cf9f21e2370ad8cad8c85 to your computer and use it in GitHub Desktop.
Save ovlb/790059a73c5cf9f21e2370ad8cad8c85 to your computer and use it in GitHub Desktop.
$testButton.addEventListener('click', (e) => {
e.preventDefault()
// In a real app there will probably be more logic to an input then just
// emitting an event. Therefore we check if fbq is defined
// to avoid exceptions after deactivating tracking
if (window.hasOwnProperty('fbq')) {
window.fbq('trackCustom', 'PixelOptOutTest')
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment