Tracking Facebook Pixel
Step 1: Add the Following JS Code After the Trigger Action Block
Immediately after the Trigger block, add a JavaScript block and add the code shown below. This initializes the pixel code so that it can start listening to tracking events fired from the chatbot.
!(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", "YOUR_FACEBOOK_PIXEL_ID");
Step 2: Add the Fire Events Code
Now, we will add the events that needs to be tracked on your pixel. To do this add a JavaScript block immediately after the block whose event you want to track.
For example, in the screenshot below I want to track the event when someone fills the form after selecting 'Talk to sales'.

We need to use a JavaScript block after the block that you want to track, and add the event tag.
Refer to the standard events supported by Facebook here.
Last updated