How to use Facebook Pixel with Gobot


In this article we show you how you can use Facebook pixel with Gobot.  FB Pixel helps businesses get the most out of Facebook’s advertising platform. It helps you track conversions from Facebook ads, optimize ads based on collected data, build targeted audiences for future ads, and remarket to qualified leads.

As a preliminary step, if you haven't already, you'll need to install your FB tracking snippet on your website in order for this feature to function.  Click here and here for more information as to installing your snippet.

Next, follow these steps:

Go to the Gobot bot dashboard, select the chatbot you want to track, and click Bot Settings. Then click on the Advanced tab and then on the Analytics & Tracking sub-tab.  Look under Facebook Pixel, and review the options in the pull-down menu. 

If you selected Automatic, all of the user interactions and user responses will be tracked in Facebook, consistent with the table below, even without you dragging the Facebook Pixel element into your bot script.

fbp(‘trackCustom’, [event], {value: [value], gobot_botid: [bot id], gobot_param1: [parameter 1], gobot_param2: [parameter 2]});

The default pull-down menu option is Custom, which allows you to specifically designate directly within your bot script which user interactions you want to track using Facebook Pixel.  User responses are not shared with Facebook when using the Custom option, Facebook is only notified of the user interaction.  Custom is the default selection - so absent action on your part no data will be sent to Facebook until you drag the Facebook Pixel element into your bot script.  The Custom option makes sense if you want to track only one or a couple of user interactions (and not the actual user response), as the shorter list will make it easier to identify those interactions in Facebook.  We will discuss the Custom option below in more detail.

If you've opted on the Custom selection, you will need to designate the user interaction you want to track. Close Bot Settings by clicking Save and you will be brought back to the bot builder.  Drag the Facebook Pixel button into your bot script directly after the user interaction you want to track.

In the right hand panel, fill in the Facebook Pixel Action field and click Save.  Select Action to correspond to whatever user interaction you want tracked.  For example, if you drag the Google Analytics button after an Email Field in a bot scripted to subscribe visitors to your newsletter, you may want to call the Action "Lead", etc.  In the example below, the field is used to collect the visitor's name, also a lead.  Optionally, you can also include Event Properties (visible only after clicking Show Advanced Options in the right hand panel).  The event properties are just extra data logged with the event. There are specific properties that the user can add, some with specific formats/data types and at least one that can be anything. Note that the Event Properties need to be in JSON format (see FB documentation for additional detail).

As soon as the bot script gets to the Facebook Pixel element in your bot script, Gobot will notify Facebook for tracking purposes!



Copyright 2019, Gobot LLC, All rights reserved.


Was this article helpful?


You might also find interest in these related articles:

  1. Track your chatbot using Google Analytics
  2. Track your bot's conversions using Google Ads (Adwords)