Skip to content

Instantly share code, notes, and snippets.

@tallesairan
Created January 13, 2020 17:23
Show Gist options
  • Save tallesairan/221ed94578b455d9dff14b1d628184bb to your computer and use it in GitHub Desktop.
Save tallesairan/221ed94578b455d9dff14b1d628184bb to your computer and use it in GitHub Desktop.
bank billet pixel tracking for facebook
<!-- 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','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'PIXELID');
fbq('track', 'PageView');
fbq('track', 'Purchase', {
content_type: 'product',
content_ids: ['59535'],
payment_type: 'BILLET',
value: '196.42',
currency: 'BRL'
});
fbq('trackCustom', 'payment_type', {value: 'BILLET'});
</script>
<noscript>
<img height='1' width='1' style= 'display:none' src='https://www.facebook.com/tr?id=PIXELID&ev=Purchase&noscript=1&cd[value]=196.42&cd[currency]=BRL&cd[content_type]=product&cd[content_ids]=59535&cd[payment_type]=BILLET' />
<img height='1' width='1' style= 'display:none' src='https://www.facebook.com/tr?id=PIXELID&ev=payment_type&cd[value]=BILLET&noscript=1' />
</noscript>
<!-- End Facebook Pixel Code -->
@natancanavez
Copy link

Oi, como eu crio cartão e boleto dentro do payment_type? Para que o evento dispare cartão ou boleto de acordo com o método de pagamento usado? Obrigado

@tallesairan
Copy link
Author

Depende do seu gateway de pagamento, você só troca billet por credit_card, qual gateway usa?

@natancanavez
Copy link

Estou usando o pagar.me. Tem só essas 2 opções, cartão e boleto. Os eventos do pixel estou criando no tag manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment