Loading...
Loading...
When the user wants to build or improve a sales bot's ability to track conversion rates, drop-off points, and response patterns. Also use when the user mentions "bot analytics," "conversation metrics," "tracking performance," "measuring bot effectiveness," or "conversion tracking."
npx skill4agent add louisblythe/salesskills performance-analyticsConversation Started
↓
First Response Received
↓
Qualified (met criteria)
↓
Meeting Booked
↓
Meeting Attended
↓
Opportunity Created
↓
Deal Closedfunction calculateFunnelMetrics(period) {
conversations = getConversations(period)
metrics = {
started: conversations.count(),
responded: conversations.filter(c => c.got_response).count(),
qualified: conversations.filter(c => c.is_qualified).count(),
booked: conversations.filter(c => c.meeting_booked).count(),
attended: conversations.filter(c => c.meeting_attended).count(),
converted: conversations.filter(c => c.became_customer).count()
}
metrics.response_rate = metrics.responded / metrics.started
metrics.qualification_rate = metrics.qualified / metrics.responded
metrics.booking_rate = metrics.booked / metrics.qualified
metrics.show_rate = metrics.attended / metrics.booked
metrics.conversion_rate = metrics.converted / metrics.attended
return metrics
}function findDropOffPoints(funnel) {
stages = ["started", "responded", "qualified", "booked", "attended", "converted"]
drop_offs = []
for (i = 0; i < stages.length - 1; i++) {
current = funnel[stages[i]]
next = funnel[stages[i + 1]]
drop_rate = 1 - (next / current)
if (drop_rate > THRESHOLD) {
drop_offs.push({
from: stages[i],
to: stages[i + 1],
drop_rate: drop_rate,
volume_lost: current - next
})
}
}
return drop_offs.sort(by_drop_rate_desc)
}ConversationMetrics = {
id: string,
channel: string,
started_at: timestamp,
ended_at: timestamp,
duration_seconds: number,
message_count: number,
bot_messages: number,
human_messages: number,
sentiment_start: float,
sentiment_end: float,
sentiment_trend: float, // end - start
intents_detected: [string],
objections_raised: [string],
qualification_score: number,
outcome: string, // qualified, disqualified, booked, escalated, etc.
escalated: boolean,
escalation_reason: string,
fallback_count: number
}function findConversationPatterns(conversations) {
patterns = {
successful: [],
failed: [],
common_paths: [],
common_objections: [],
common_drop_points: []
}
// Analyze successful conversations
successful = conversations.filter(c => c.outcome == "converted")
patterns.successful = extractCommonPatterns(successful)
// Analyze failed conversations
failed = conversations.filter(c => c.outcome in ["dropped", "disqualified"])
patterns.failed = extractCommonPatterns(failed)
// Find where conversations diverge
patterns.divergence_points = findDivergencePoints(successful, failed)
return patterns
}function compareSegments(metric, segments) {
results = []
for (segment in segments) {
data = getData(segment)
result = {
segment: segment.name,
value: calculate(metric, data),
sample_size: data.count(),
confidence: calculateConfidence(data)
}
results.push(result)
}
// Statistical comparison
return {
segments: results,
best_performing: findBest(results),
significant_differences: findSignificantDifferences(results)
}
}alerts = [
{
metric: "response_rate",
condition: "drops_below",
threshold: 0.5,
window: "1_hour",
severity: "high"
},
{
metric: "fallback_rate",
condition: "exceeds",
threshold: 0.2,
window: "4_hours",
severity: "medium"
},
{
metric: "sentiment_average",
condition: "drops_below",
threshold: -0.2,
window: "1_hour",
severity: "high"
}
]// Track all meaningful events
trackEvent({
event_type: "conversation_started",
conversation_id: "abc123",
channel: "sms",
timestamp: now(),
properties: {
source: "website_form",
lead_score: 72
}
})
trackEvent({
event_type: "message_received",
conversation_id: "abc123",
message_id: "msg456",
timestamp: now(),
properties: {
sender: "prospect",
content: "...",
intent: "interested",
intent_confidence: 0.87,
sentiment: 0.3
}
})
trackEvent({
event_type: "meeting_booked",
conversation_id: "abc123",
timestamp: now(),
properties: {
meeting_date: "2024-01-15",
meeting_type: "demo",
assigned_rep: "rep_789"
}
})Events → Queue → Processing → Storage
↓
Aggregation
↓
Dashboards
↓
Alertsconversations:
- id, channel, started_at, ended_at, outcome, ...
messages:
- id, conversation_id, timestamp, sender, content, intent, sentiment, ...
events:
- id, conversation_id, event_type, timestamp, properties
metrics_daily:
- date, metric_name, segment, value
metrics_hourly:
- timestamp, metric_name, segment, value