Use Facebook Pixel to track LiveChat-related data and see how many chats, surveys or tickets have your customers engaged in. Learn more about your visitors browsing habits and make use of all the valuable data you have gathered!
- Add Facebook Pixel - learn how to add Facebook Pixel to your website;
- Integrate LiveChat with Pixel - learn how to integrate LiveChat with Facebook Pixel.
- View LiveChat events in Facebook Ads Manager - learn how to view LiveChat events stored in your Facebook Ads Manager.
Add Facebook Pixel
Facebook pixel is a small analytics code for your website. With the use of it, you can track the visitor’s movement, along with custom events that your customers can engage in. Use this advantage to measure actions that people take on your website and create more effective Facebook advertising campaigns.
- To create your Facebook Pixel, log onto your Facebook Account and go to the Facebook Pixel tab in Ads Manager. There, click on the Create a Pixel button.
- In the next section, name your new Pixel and click Next button to continue.
- There are two ways to add Facebook Pixel to your website. You can use a software like Google Tag Manager, or you can copy the Pixel code and paste it into your website’s HTML manually.
- After implementing the Facebook Pixel’s code on your website, Facebook Ads manager will start tracking the movement on your page.
Done! Facebook Pixel is now added to your website, and you can integrate it with LiveChat! Use this opportunity to create better-targeted Facebook advertising campaigns!
Integrate LiveChat with Pixel
To integrate LiveChat with Facebook Pixel, all you have to do is to modify the LiveChat tracking code added to your website. After doing so, you will be able to track the following events:
- Pre-chat submitted - this event will be stored every time your website visitor will submit a pre-chat survey;
- Chat Started - this event will be stored every time your visitor will start a chat with you;
- Post-chat submitted - this event will be stored every time your website visitor will submit a post-chat survey;
- Ticket created - this event will be stored every time your website visitor will leave you an offline message.
- To integrate LiveChat with Facebook Pixel, modify your LiveChat code by adding the additional code snippet to it. You can add the snippet just before the closing tag of your LiveChat code.
var LC_API = LC_API || {};
LC_API.on_prechat_survey_submitted = function(data)
{
fbq('trackCustom', 'LiveChat', { event: 'Pre-chat submitted' });
};
LC_API.on_chat_started = function(data)
{
fbq('trackCustom', 'LiveChat', { event: 'Chat Started' });
};
LC_API.on_postchat_survey_submitted = function(data)
{
fbq('trackCustom', 'LiveChat', { event: 'Post-chat submitted' });
};
LC_API.on_ticket_created = function(data)
{
fbq('trackCustom', 'LiveChat', { event: 'Ticket created' });
};
- After adding the snippet, your LiveChat code will look like on the following example:
<script type="text/javascript">
window.__lc = window.__lc || {};
window.__lc.license = XXXXXX;
(function() {
var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
})();
var LC_API = LC_API || {};
LC_API.on_prechat_survey_submitted = function(data)
{
fbq('trackCustom', 'LiveChat', { event: 'Pre-chat submitted' });
};
LC_API.on_chat_started = function(data)
{
fbq('trackCustom', 'LiveChat', { event: 'Chat Started' });
};
LC_API.on_postchat_survey_submitted = function(data)
{
fbq('trackCustom', 'LiveChat', { event: 'Post-chat submitted' });
};
LC_API.on_ticket_created = function(data)
{
fbq('trackCustom', 'LiveChat', { event: 'Ticket created' });
};
</script>
Done! Now LiveChat is integrated with Facebook Pixel and you can track LiveChat-related events straight in your Facebook Ads manager.
View LiveChat events in Facebook Ads manager
- To view LiveChat-related events, log into your Facebook Ads Manager.
- There you will find the list of events tracked by your Google Pixel. To view the LiveChat-related ones, click on the eye button available on the right .
- And that’s it! The list of LiveChat events will appear in a new window.
Hopefully, you have found this article helpful but if you have any additional questions, feel free to start a chat with us - we are available 24/7/365!