You're running Facebook Ads to drive traffic to your website. Visitors land, open your live chat, and some become leads. But Facebook Ads has no idea that happened — so it can't optimize for it.
By tracking live chat conversions in Facebook Pixel (now called Meta Pixel), you can tell Meta exactly which ad clicks led to chat conversations. That means better ad optimization, lower cost per lead, and the ability to retarget visitors who chatted but didn't convert.
Before getting into the setup, here's what becomes possible once chat events flow into your Pixel:
Optimize for chat leads — Tell Meta to show your ads to people most likely to start a chat conversation, not just visit your page
Build custom audiences — Create audiences of "visitors who opened chat" or "visitors who submitted their contact info via chat"
Create lookalike audiences — Find new prospects who resemble your chat leads
Measure true ROAS — See which ad sets generate chat leads, not just clicks
Retarget chatters — Show follow-up ads to visitors who chatted but didn't buy
This method works if your live chat tool exposes JavaScript events. You'll fire Pixel custom events when visitors interact with the chat.
Make sure the Meta Pixel base code is on your website. You can verify in Events Manager → Test Events → enter your URL and check that the PageView event fires.
Check your live chat provider's documentation for event callbacks. Examples:
// LiveChat
LiveChatWidget.on('form_submitted', function(data) {
fbq('trackCustom', 'ChatLeadCaptured', {
content_name: 'live_chat_form'
});
});
// Tidio
document.addEventListener('tidioChat-open', function() {
fbq('trackCustom', 'ChatOpened');
});
// Zendesk Chat
zE('messenger:on', 'open', function() {
fbq('trackCustom', 'ChatOpened');
});
Add the fbq('trackCustom', ...) calls where your chat tool fires its events. The two most useful events:
// When someone opens the chat widget
fbq('trackCustom', 'ChatOpened');
// When someone submits their info (the actual conversion)
fbq('trackCustom', 'ChatLeadCaptured', {
content_name: 'live_chat',
value: 10.00,
currency: 'USD'
});
Adding a value parameter lets Meta calculate ROAS for your chat conversions.
If you prefer GTM:
Create a Custom Event trigger for your chat tool's dataLayer events
Create a Custom HTML tag with the fbq('trackCustom', ...) code
Connect the trigger to the tag
Test in GTM Preview mode
Open Events Manager in your Meta Business Suite
Go to Test Events
Open your website and interact with the chat
Confirm ChatOpened and ChatLeadCaptured appear
In Events Manager, go to Custom Conversions
Click Create Custom Conversion
Select the ChatLeadCaptured event
Name it "Chat Lead" and assign a value
Save
Now you can use "Chat Lead" as an optimization objective in your Facebook ad campaigns.
Iframe widgets — Most live chat tools load inside an iframe. You can't fire fbq() from inside an iframe on a different domain. Your chat provider needs to support cross-frame messaging or have a built-in Pixel integration.
iOS 14+ and tracking prevention — Apple's App Tracking Transparency limits Pixel tracking for iOS users. Expect to miss 30-40% of events from iPhone visitors. Meta's Aggregated Event Measurement helps, but it's not perfect.
Consent mode — If you use a cookie consent banner in the EU, the Pixel won't fire until the visitor accepts marketing cookies. This is legally required under GDPR but means you'll undercount conversions.
Conversions API — For more reliable tracking, Meta recommends using the Conversions API (server-side) alongside the Pixel (client-side). But this requires backend development and is overkill for most small businesses.
The manual setup has real limitations — iframe restrictions, iOS tracking gaps, and JavaScript complexity. Boei sidesteps all of this.
Boei is a website widget with live chat, AI chatbot, and 50+ contact channels. It pushes events to Meta Pixel (and other analytics tools) automatically.
Add channels to your Boei widget — live chat, AI chatbot, WhatsApp, phone, email, or any of the 50+ options
Toggle on Facebook Pixel in your widget's analytics settings
Events fire automatically:
BoeiOpened → visitor opens the widget
BoeiConversion → visitor clicks a channel or submits contact info
No iframe problems — Boei pushes events directly to your Pixel, not from inside an iframe
All channels tracked — WhatsApp, Telegram, phone calls, email, contact forms, and AI chatbot are all tracked in the same Pixel events
Custom event names — Set channel-specific event names like WhatsAppClick or LiveChatStart
Lead data pushed to Pixel — Email, phone, and name are automatically included for better audience matching
Works alongside GA4 — Enable Google Analytics, GTM, Plausible, and Facebook Pixel simultaneously
Plans start from $8/month (without AI chatbot) or $14/month (with AI chatbot included). 7-day free trial, no credit card required.
Once events are flowing into your Pixel, here's how to put them to work.
In Ads Manager, create or edit a campaign
Set the campaign objective to Leads or Conversions
At the ad set level, choose your custom conversion "Chat Lead" (or BoeiConversion) as the optimization event
Meta will now show your ads to people most likely to start a chat, not just click a link
Go to Audiences → Create Audience → Custom Audience
Source: Website
Select the ChatOpened or BoeiOpened event
Set the time window (e.g., last 30 days)
Save
Use this audience to retarget visitors who opened the chat but didn't leave their info. Show them a follow-up ad with a stronger offer.
Go to Audiences → Create Audience → Lookalike Audience
Source: your "Chat Lead" custom audience
Select your target country
Choose 1% for closest match, 5-10% for broader reach
Meta will find new people who resemble your chat leads. These audiences typically outperform interest-based targeting because they're based on actual conversion data.
In Ads Manager, add the "Chat Lead" custom conversion as a column:
Click Columns → Customize Columns
Search for your custom conversion name
Add it to your view
Now you can see exactly how many chat leads each ad set generates and at what cost per lead.
It depends. If your chat tool exposes JavaScript event callbacks and doesn't load inside a restrictive iframe, you can add fbq() calls manually. Some tools like LiveChat have a built-in Facebook Pixel integration. Others like Zendesk and Intercom require custom code. Boei includes Pixel integration natively.
Standard events (like Lead, Contact, Purchase) are predefined by Meta and get special optimization treatment. Custom events (like ChatOpened) are events you define yourself. For chat tracking, custom events work well because Meta doesn't have a standard "chat opened" event. You can also map custom events to standard events using custom conversions.
Since iOS 14.5, Apple requires apps to ask permission before tracking. Many users opt out, which means Meta Pixel doesn't fire for those visitors. To mitigate this: (1) verify your domain in Business Settings, (2) prioritize up to 8 conversion events in Events Manager, (3) consider implementing the Conversions API for server-side tracking. Expect 30-40% of iOS events to be lost regardless.
Yes. Use different event names: ChatLeadCaptured for chat leads and Purchase for sales. In custom conversions, create separate entries for each. In Ads Manager, you can view both as separate columns to understand which campaigns drive chat leads vs. direct purchases.
Meta recommends at least 50 conversion events per week per ad set for optimal algorithm learning. If your chat volume is lower than that, optimize for a higher-funnel event (like ChatOpened) and use chat leads as a secondary metric. As volume grows, switch your optimization to the lead event.
No. Custom events like ChatOpened don't interfere with standard events like PageView, ViewContent, or Purchase. They simply add more data points to your Pixel. Each event fires independently.
Article by
Ruben is the founder of Boei, with 12+ years of experience in conversion optimization. Former IT consultant at Ernst & Young and Accenture, where he helped product teams at Shell, ING, Rabobank, Aegon, NN, and AirFrance/KLM optimize their digital experiences. Now building tools to help businesses convert more website visitors into customers.
Get 30% more conversations and effortlessly convert them into customers.
Don't wait, experience it for free yourself!
URL
Trusted by 10,000+ businesses
Quick 5-min, no code setup
Learn how to add Facebook Messenger chat to your WordPress site. Let readers message you directly from your blog without leaving the page.
Easily add a WhatsApp chat button to your website with our step-by-step guide. Enhance communication and user engagement effortlessly.
I compared message credit systems across 8 AI chatbot platforms. See what each response actually costs on budget, mid-tier, and premium AI models.
I compared how 10 AI chatbot platforms measure training data: characters, pages, MB, and words. See normalized costs per dollar.
Discover 18 proven AI chatbot use cases across customer support, sales, e-commerce, and HR. Real examples with ROI metrics and implementation tips.