Problem
Mograh is a real brand, my mum's. Like most small e-commerce businesses it had sales data but no reporting layer: no agreed events, no way to ask a question of the data without exporting a spreadsheet, and no idea which customers were worth keeping. The figures here are synthetic, generated to match the brand's shape, and labelled as such throughout.
Method
A GA4 measurement plan first, so every number downstream means something agreed. On top: a SQL reporting layer using window functions and CTEs, surfaced in Looker Studio; a LangChain-to-SQL layer so a non-technical owner can ask questions in plain English; RFM scoring with k-means segmentation; and an LTV model per segment.
Evaluation
The segmentation found one fact that outweighs everything else: 914 of 920 buyers bought exactly once. The growth problem is not acquisition, it is the second purchase. Modelling it: lifting repeat rate from 0.65% to 20% raises LTV by roughly 25%. The natural-language layer was tested against five questions with known answers: 3/5 right. The two misses are the finding: it couldn't route a product question through cart events, and asked for RFM segments it wrote fluent, plausible SQL for a segmentation that doesn't exist, because the real one lives outside the database. Wrong answers that look right are the risk with text-to-SQL, and the fix is scope, not a better prompt.
The decision it drives
Stop spending on new-customer ads until the second-purchase problem is fixed, and measure that fix with the events already in place.