Table of Contents

Facebook Pixel - Track Events (only Embedded)

Pau Sanchez Updated by Pau Sanchez

This process is only suitable for Embedded landbots. Due to the new Facebook regulations and domain verification process, standalone landbots (using our url) might stop working tracking events.

Bot is embedded in a site

When your bot is embedded in one of the four different ways available: Fullpage, Popup, Embed or Livechat (with custom domain).

In Landbot 3

You should apply this process when landbot is embedded into your website - using a domain that’s different from “landbot.io”. This process is very useful to track landbot and leads conversions, track events with Facebook Pixel

How the code in your site is going to look like with the snippets in these instructions:

<html>

<head>

<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', '121071555287839'); fbq('track', 'PageView'); </script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=121071555287839&ev=PageView&noscript=1" /></noscript>

</head>

<body>

</body>

<script src="https://static.landbot.io/landbot-widget/landbot-widget-1.0.0.js"></script>
<script> var myLandbot = new LandbotLivechat({
index: 'https://landbot.io/u/H-XXXXXX-XXXX/index.html', });
</script>

</html>

What to edit in the Site (container):
  1. Be sure you're using a standard Facebook Pixel Code implementation like this one:
In the code below, please change the 121071555287839 for your Facebook Pixel ID


<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', '121071555287839'); fbq('track', 'PageView'); </script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=121071555287839&ev=PageView&noscript=1" /></noscript>

  1. Add your Landbot to your container’s webpage using the snippet provided by the app:

<script src="https://static.landbot.io/landbot-widget/landbot-widget-1.0.0.js"></script>
<script> var myLandbot = new LandbotLivechat({
index: 'https://landbot.io/u/H-XXXXXX-XXXX/index.html', });
</script>

What to edit in your bot (Landbot builder):
  1. In your chatbot builder, add this code to a Code . This is the point in the flow when you want to send the event to Facebook. Replace the parameters with your own values:
window.fbq('track','Lead')

Change the example values with your own values. You can use landbot variable there.

FAQ & Troubleshooting

How can I check if the tracking is working correctly?

To test that you installed the pixel correctly, install the Chrome Pixel Helper extension (it’s free!) and then visit your site.

Channel Type compatibility

for Web

This feature is fully compatible.

for WhatsApp

This feature is not compatible with WhatsApp.

for Messenger

This feature is not compatible with Messenger.

How did we do?

Contact