Chatbot Analytics (Funnels, Conversions) Implementation in Mobile App
Chatbot without analytics is a black box. How many users completed the funnel? Where do they drop off? Which scenario converts better? Answers to these questions are bot analytics, and mobile app is convenient way to get data anytime.
Funnel: How It Works Under the Hood
Funnel in chatbot context — sequence of steps (states) in scenario. User starts bot → sees greeting → answers qualification question → clicks transition button → leaves contact → gets offer.
On backend each event logged with user_id, conversation_id, step_name, timestamp. Funnel built by aggregation: how many unique users reached each step.
-- Funnel aggregation example
SELECT
step_name,
COUNT(DISTINCT user_id) as users,
LAG(COUNT(DISTINCT user_id)) OVER (ORDER BY step_order) as prev_step_users
FROM conversation_events
WHERE bot_id = $1 AND created_at BETWEEN $2 AND $3
GROUP BY step_name, step_order
ORDER BY step_order;
Conversion per step = users / prev_step_users. Mobile app gets ready funnel data via API.
Funnel Visualization
Classic funnel — decreasing horizontal bars:
// Flutter — custom funnel widget
class FunnelChart extends StatelessWidget {
final List<FunnelStep> steps;
@override
Widget build(BuildContext context) {
final maxUsers = steps.first.users;
return Column(
children: steps.map((step) {
final widthFraction = step.users / maxUsers;
final conversion = step.conversionFromPrev;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(step.name, style: Theme.of(context).textTheme.labelMedium),
Row(
children: [
Expanded(
child: FractionallySizedBox(
widthFactor: widthFraction,
child: Container(
height: 36,
decoration: BoxDecoration(
color: _conversionColor(conversion),
borderRadius: BorderRadius.circular(4),
),
alignment: Alignment.centerRight,
padding: const EdgeInsets.only(right: 8),
child: Text(
'${step.users} (${(conversion * 100).toStringAsFixed(1)}%)',
style: const TextStyle(color: Colors.white, fontSize: 12),
),
),
),
),
],
),
],
),
);
}).toList(),
);
}
Color _conversionColor(double conversion) {
if (conversion > 0.7) return Colors.green;
if (conversion > 0.4) return Colors.orange;
return Colors.red;
}
}
Segment color codes conversion: green > 70%, orange 40–70%, red < 40%. Bottleneck visible immediately.
Metrics and Dashboard
Besides funnel, analytics dashboard contains:
Operational metrics (for period):
- Total new conversations
- Average conversation duration
- % conversations escalated to operator
- % conversations with no user response (dropped after bot's first message)
Conversion metrics:
- Goal events (bot-specific: submitted request, left contact, clicked offer button)
- Conversion by channel: Telegram vs WhatsApp vs Web Widget
Retention:
- How many users returned to bot after 7 days, 30 days
Period selected via date picker — last 7 days / last 30 days / custom range. Custom range on mobile — showDateRangePicker (Flutter) or UICalendarView (iOS 16+).
Scenario Comparison (A/B)
If bot runs scenario A/B test — show parallel funnels. Table: rows — funnel steps, columns — variant A and variant B with each step conversion. Best result cell — green background.
| Step | Variant A | Variant B |
|---|---|---|
| Start | 1,240 (100%) | 1,198 (100%) |
| Qualification | 890 (71.8%) | 956 (79.8%) |
| Offer | 320 (35.9%) | 412 (43.1%) |
| Request | 98 (30.6%) | 145 (35.2%) |
What's Included
- Dashboard with key metrics and period switcher
- Funnel visualization with color-coded conversion
- Breakdown by channel (Telegram, WhatsApp, Web)
- A/B variant comparison table
- Drill-down: tap funnel step → list of users stopped at that step
Timeline
5–7 working days. Cost calculated individually after requirements analysis.







