Your chatbot is generating leads, but are they showing up in Google Analytics? Most chatbot tools handle conversations fine, but don't send any data to GA4. That means your reports show page views but miss the actual conversions happening inside the chat widget.
This guide walks you through tracking chatbot leads in GA4: the manual way using events and GTM, and a zero-code alternative. If you're looking for a complete overview of GA4 chatbot integration, see our Google Analytics integration page. For broader analytics capabilities, check out Boei's built-in analytics dashboard.
| Manual (gtag.js / GTM) | Automatic (Boei) | |
|---|---|---|
| Setup time | 30-60 minutes | 2 minutes |
| Events tracked | Only what you configure | Opens, leads, and channel clicks out of the box |
| Ongoing maintenance | Update code when chatbot provider changes | None - handled automatically |
| Iframe compatibility | Blocked by most chat widgets | Works natively, no iframe issues |
| Accuracy | Depends on implementation quality | Consistent, pre-tested event firing |
Before diving into setup, decide which chatbot interactions matter most. Here are the events worth tracking:
| Event Name | When It Fires | Why It Matters |
|---|---|---|
chatbot_opened |
Visitor opens the chat widget | Measures engagement / interest |
chat_started |
Visitor sends first message | Measures intent |
lead_captured |
Visitor submits email/phone/name | This is your conversion |
chat_handoff |
AI escalates to human agent | Measures AI coverage gaps |
chat_completed |
Conversation ends | Measures completion rate |
The most important one is lead_captured. That's when a visitor gives you their contact information. Everything else is supporting data.
If your chatbot provider exposes JavaScript events or callbacks, you can push events to GA4 directly.
Most chatbot tools have an API or callback system. Check your provider's docs for event hooks. Common patterns:
// Tidio example
document.addEventListener('tidioChat-open', function() {
gtag('event', 'chatbot_opened');
});
// Intercom example
Intercom('onShow', function() {
gtag('event', 'chatbot_opened');
});
// Drift example
drift.on('startConversation', function() {
gtag('event', 'chat_started');
});
If your chatbot doesn't expose JavaScript events, skip to Method 2 or Method 3.
Use the gtag() function to send custom events. Add event parameters to capture useful context:
// When a lead is captured
gtag('event', 'lead_captured', {
'event_category': 'chatbot',
'event_label': 'email_submitted',
'page_path': window.location.pathname
});
Place this code where your chatbot fires its lead capture callback.
For your event parameters to appear in reports:
event_category, event_label, or whatever parameters you're sendinglead_captured in the event listNow GA4 treats every chatbot lead as a conversion. This flows through to Google Ads if you've linked your accounts.
If you prefer GTM over inline code, you can use the dataLayer approach.
Add this code to your website, triggered by your chatbot's events:
// When chat widget opens
dataLayer.push({
'event': 'chatbot_opened',
'chatbot_provider': 'your-chatbot-name'
});
// When a lead is captured
dataLayer.push({
'event': 'lead_captured',
'chatbot_provider': 'your-chatbot-name',
'lead_type': 'email'
});
lead_capturedRepeat for any other events you want to track.
lead_capturedBoth methods above require:
If your chatbot loads inside an iframe (which many do), you can't access its DOM or events from your page at all. This is the most common blocker.
Boei includes a built-in AI chatbot that automatically sends lead events to your analytics. No code, no GTM, no iframe workarounds.
BoeiOpened → visitor opens the chatbotBoeiConversion → visitor submits their contact infoPlans start from $19/month with the AI chatbot included (2,000 AI messages/month). 7-day free trial, no credit card required.
Once events are flowing (via any method), here's how to get value from the data.
In GA4 Explore, create a funnel exploration:
page_view (any page)chatbot_opened (or BoeiOpened)lead_captured (or BoeiConversion)This shows you the drop-off at each stage. If many visitors open the chatbot but few submit their info, you may need to adjust your lead capture timing or questions.
Create a GA4 segment for chatbot leads and break it down by source/medium. You'll see whether chatbot leads come from organic search, paid ads, social media, or direct traffic. This helps you allocate budget to the channels that drive the most chatbot conversations.
lead_captured or BoeiConversion eventGoogle Ads will now optimize your campaigns toward visitors who are likely to chat and leave their contact info, not just visitors who view your page.
It depends on whether they expose JavaScript events. Tidio and Intercom have documented event hooks. Drift has a JavaScript API. But most load inside iframes, which limits what you can track from your page. Check your provider's docs for "Google Analytics integration" or "event tracking."
A chatbot open means someone clicked the chat icon. A lead means they submitted contact information (email, phone, name). Opens measure interest; leads measure conversions. Track both, but mark only lead_captured as a GA4 conversion.
Events appear in DebugView immediately. In standard reports, they can take 24-48 hours. The event will appear in your Events list within 24 hours, at which point you can mark it as a conversion.
Technically yes, using event parameters. But sending personally identifiable information (PII) like email addresses to GA4 violates Google's Terms of Service. Instead, send a hashed version or a lead ID that you can match in your CRM. Boei handles this by pushing lead data to analytics in a privacy-compliant way.
If you use a consent management platform, GA4 tags won't fire until the visitor accepts analytics cookies. This means you may undercount chatbot interactions from visitors who decline cookies. Google's Consent Mode v2 can model conversions for non-consenting users, but the actual events won't fire.
Add page_path as an event parameter. In GA4, create a custom report with the lead_captured event filtered by page path. This tells you exactly which pages drive chatbot conversations, so you can add the chatbot to more pages like those.
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 17,000+ businesses
Quick 5-min, no code setup
Learn how internal chatbots help employees find answers faster. 8 use cases, tool comparison, setup steps, and ROI data for HR, IT, and operations teams.
Discover how a lead generation chatbot captures, qualifies, and converts leads 24/7. Complete 2026 guide with strategies, examples, and setup steps.
Build a lead generation funnel that converts 3x better. Simple 6-step guide with examples, tools, and AI tips to turn visitors into customers.
Learn how to become a lead generation specialist and generate leads for your business. Discover the key skills, strategies, and tools needed for success.
Learn how to build a lead pipeline with AI and CRM. Automate capture, qualification, nurture, and close stages to convert more visitors.