Pricing
Go to app
User Name
Upgrade Help Center

Facebook Pixel: track LiveChat data

Krzysztof Kraus
4 min read
updated: Jun 1, 2023

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 PixelLink icon

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.

  1. 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.

Create your Facebook Pixel

  1. In the next section, name your new Pixel and click Next button to continue.

Name your Facebook Pixel and click on Next to continue

  1. 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.

Choose how would you like to add Facebook Pixel to your website

  1. After implementing the Facebook Pixel’s code on your website, Facebook Ads manager will start tracking the movement on your page.

Facebook Pixel: track LiveChat data

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 PixelLink icon

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.
  1. 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' });
};
  1. 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>
You can copy the LiveChat snippet from above and use it to replace the current code added to your website. When doing so, remember to replace the XXXXXX in the window.__lc.license = XXXXXX; line with your own license number!
You can copy the LiveChat snippet from above and use it to replace the current code added to your website. When doing so, remember to replace the XXXXXX in the window.__lc.license = XXXXXX; line with your own license number!

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 managerLink icon

  1. To view LiveChat-related events, log into your Facebook Ads Manager.

Facebook Pixel: track LiveChat data

  1. 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
  2. .

Click on eye-button to see your LiveChat-related data

  1. And that’s it! The list of LiveChat events will appear in a new window.

List of LiveChat events

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!

Was this article helpful?

Got it!

Thanks for your feedback.

Thank you!

We’re happy to help.

RELATED ARTICLES

14 quick ways to get more chats

Learn how to improve your chat channel by getting more conversations with clients. Enhance your online customer service with 14 universal tips.

Read the article

Start using LiveChat now!

Free 14-day trial Team plan features No credit card required

Still not convinced? Discover all LiveChat features

Discover text| products: