Analytics Engineering for Conversational Commerce: Attribution, Funnels, and Rollups
Business owners do not buy messaging software for "messages sent" vanity counts; they want to know which ads and campaigns actually produced conversations and paid sales, and how fast their team responds. Building trustworthy analytics requires clear attribution rules, honest metric definitions, and pre-aggregated read models.
Core Conversational Commerce Metrics
| Metric | Definition | Common Calculation Trap |
|---|---|---|
| Reply Rate | Unique recipients who replied / accepted sends | Dividing by attempted sends instead of accepted sends hides delivery issues |
| First Human Response Time | Elapsed time from customer message to first teammate reply | Averaging outliers instead of showing median (P50) and P90 |
| Ad-to-Sale Attribution | Net paid revenue linked to ad-sourced conversations in window | Double-counting refunded orders or mixing ad currency with local revenue currency |
| Cost Per Replied Conversation | Campaign + ad spend / unique replied threads | Omitting free-entry-point windows or mixing Meta vs workspace definitions |
Pre-Aggregated Rollups Beat Live Full-Table Aggregations
Running GROUP BY across millions of raw message documents on every dashboard page load creates slow spinners and database CPU spikes. Instead, project incremental daily/hourly rollups (an acquisition & conversion ledger) whenever key domain events happen:
- Conversation created with referral source (
ad_id,campaign_id,utm). - Campaign message accepted, delivered, read, or replied.
- Order confirmed or refunded (subtracting refunds from net revenue!).
export interface AttributionWindowCheck {
conversationStartedAtMs: number;
orderPaidAtMs: number;
windowDays: number;
}
export function isWithinAttributionWindow(input: AttributionWindowCheck): boolean {
const deltaMs = input.orderPaidAtMs - input.conversationStartedAtMs;
const maxMs = input.windowDays * 24 * 60 * 60 * 1000;
return deltaMs >= 0 && deltaMs <= maxMs;
}
Currency and Timezone Honesty
Never silently sum USD ad spend with KZT or EUR order revenue. Store explicit ISO currency codes on every monetary fact, align daily buckets to the workspace's configured timezone, and label date boundaries ("full calendar months, net of refunds") transparently in the UI.
Next: keep analytics dashboards and docs pages lightning-fast in the browser with Next.js App Router Performance.