Lead Tracker — 计算配置

Source of truth: studio-website-monorepo/apps/api/src/routes/v3/dashboard-lead-tracker.ts last_verified: 2026-05-29

Lead Tracker 数据来自 GET /v3/dashboard/lead-tracker?storeId=...&period=rolling-7d|last-week|last-month。采用 cohort 方式:先找到选定时段内的入站 lead,再追踪这批 lead 的后续转化。


Speed to Lead

从 lead 首次入站通话到首次外呼回复的响应时间。

指标产品定义SQL 口径状态
中位响应时间lead 首次 inbound → 首次 outbound 的分钟数中位数PERCENTILE_CONT(0.5) on EXTRACT(EPOCH FROM (first_response - first_inbound)) / 60✅ 已接线
平均响应时间同上,取均值ROUND(AVG(...))✅ 已接线
分布4 档时间桶<= 900s / 900-3600s / 3600-7200s / > 7200s✅ 已接线
Not Attempted有 inbound 但 7 天内无 outbound 的 lead 数received - total_contacted(前端计算)✅ 前端计算

7 天窗口:只查 lead inbound 后 7 天内的 outbound 作为 "首次回复"。超过 7 天的不计入 speed 统计。


漏斗

Cohort 追踪:选定时段内首次出现的 lead,追踪同一批 lead 的转化。

阶段产品定义SQL 口径状态
Received选定时段内有 inbound intro 通话的独立 contact_phone 数(基于 calls 表 cohort,不是 contacts.lifecycle_stageCOUNT(DISTINCT contact_phone) WHERE direction = 'Inbound' AND (primary_subcategory = 'intro_booking' OR lead_id IS NOT NULL) AND call_state IS DISTINCT FROM 'voicemail' AND contact_phone IS NOT NULL✅ 已接线
First OutreachReceived 中有任何 outbound 通话的数量EXISTS outbound call for same contact_phone in period✅ 已接线
Booked IntroFirst Outreach 中有 primary_subcategory = 'intro_booking' + primary_outcome_result = 'success' 的数量(不是 contacts.lead_status = 'booked'EXISTS primary_subcategory = 'intro_booking' AND primary_outcome_result = 'success'✅ 已接线
Contacted(接通)Outreach 中实际接通的数量当前 endpoint 的 "contacted" = 有 outbound call,不区分接通⚠️ 待开发

3 层 vs 4 层:当前后端实现是 3 层(Received → Contacted → Booked)。endpoint 里的 contacted 实际等同于 "有 outbound call"(即 outreach),不区分是否接通。4 层漏斗需后端增加接通判断逻辑。

转化率

指标公式状态
Contact Ratecontacted / received × 100✅ 已接线
Book Ratebooked / contacted × 100✅ 已接线
Overall Conversionbooked / received × 100✅ 已接线

趋势

同时查询上期(同长度前一时段)的漏斗数据,计算 delta。