Skip to content

Instantly share code, notes, and snippets.

@mafellows
Created April 1, 2020 01:20
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 mafellows/10f3f199e52e55b7be563228f66a553e to your computer and use it in GitHub Desktop.
Save mafellows/10f3f199e52e55b7be563228f66a553e to your computer and use it in GitHub Desktop.
<script type="text/javascript">
!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',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '2040485802644853');
window.addEventListener(WebPlatform.Events.WEBSITE_SUBSCRIBED, function(event) {
// event.detail.extra holds the subscription amount, "15.50" for $15.50 subscription
fbq('track', 'Purchase', {currency: "USD", value: event.detail.extra.amount})
}); window.addEventListener(WebPlatform.Events.NEW_REGISTRATION, function(event) {
fbq('track', 'Lead');
}); window.addEventListener(WebPlatform.Events.PAGE_LOADED , function(event) { }); window.addEventListener(WebPlatform.Events.WEBSITE_CANCELED, function(event) { });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment