You can add Facebook Tracking Pixels to your responsive site to track events. Create your Facebook Tracking Pixel code in the Facebook Pixel tab.
Add Facebook Tracking Pixel
Sezione Script |
---|
<!-- 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', 'XXXXXXXXXXXXXXX');fbq('track', 'PageView'); </script> |
Sezione NoScript |
<noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=XXXXXXXXXXXXXXX&ev=PageView&noscript=1"/> </noscript> <!-- End Facebook Pixel Code --> |
- Per accedere alla sezione Body end HTML, nel riquadro sinistro fai clic su Impostazioni, quindi su Head HTML.
- Incolla la parte <script> del codice fornito da Facebook nella sezione Body end HTML, quindi fai clic su Salva. Il codice dovrebbe essere simile a quello di seguito.
- Incolla anche la parte <noscript> del codice fornito da Facebook nella sezione HTML finale del corpo, quindi fai clic su Salva.
Considerations for Facebook Tracking Pixels
- Similar to Google Tag Manager, Facebook recommends to place the noscript code in the beginning of the body section. This is a workaround they suggests to get around limitations of old web browsers which do not load header code.
- Website Builder has completed extensive testing and the body-end.html section of developer mode works for adding the noscript code.
- For more information about Facebook Pixel Implementation, see this guide.