Meta Pixel in JavaScript Events (Reference)

Article Details

Summary

This example shows the code to add to the Customer app footer field on the System-wide Settings page. The code tells Meta Pixel (Facebook Pixel) when a customer requests a reservation in Gingr.

Before You Begin

  • Set up Meta Pixel first. See Meta Pixel.
  • Replace MY_FB_PIXEL_ID in the example with the Pixel ID from Facebook. You can also open your Meta Pixel Dashboard to get the code for your account.

What This Does

<!-- Facebook 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','//connect.facebook.net/en_US/fbevents.js');
fbq('init', 'MY_FB_PIXEL_ID');
</script>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=MY_FB_PIXEL_ID&ev=Reservation&noscript=1"/></noscript>
<!-- End Facebook Pixel Code -->
<script>
document.addEventListener('reservation_created', function (e) { fbq('track', 'Lead', {});}, false);
</script>

Related Articles

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.