Conversion paths and budget planning
Both live on the web analytics Attribution page (tabs Conversion paths and Budget planning) and use the page's conversion settings: a conversion event or...
Both live on the web analytics Attribution page (tabs Conversion paths and Budget planning) and use the page's conversion settings: a conversion event or saved goal, the lookback window, channel or campaign, and the date range. Touches are the person's sessions inside the lookback window before each conversion, the same journeys every attribution model uses.
Conversion paths
GET /v1/projects/{id}/web/attribution/paths (plus the attribution parameters, model, limit 1..500 default 50, collapse_repeats default true).
Paths: touch sequences, oldest first (
Organic Search > Email ×2 > Direct), with conversions, revenue in the base currency, share of conversions that had a touch, and mean days from first touch.Assisted versus last touch per key: assisted counts each conversion once per key that was on the path but not last;
assist_ratio = assisted / last_touch(above 1 opens or nurtures, below 1 closes).Early / mid / late: by position the first 25% of a path's touches are early, the last 25% late, the rest mid (one touch is late; two are early and late). Each touch earns the chosen model's weight;
data_drivenweighs touches by their key's Markov removal share.Touches to conversion (
1..9,10+) and days to conversion from the first touch (0..29,30+).
Budget planning
GET /v1/projects/{id}/web/budget/curves fits, per key with ad spend, daily spend (base currency, at the day's rate) against the conversions the chosen model (default linear) credits to that key on that day: conversions = a * spend^b, least squares on log-log days with both spend and conversions, b held in [0.05, 1] so returns diminish. With fewer than 5 such days the fit is a straight line through the origin and has no range. The response carries the curve (0 to twice the largest daily spend) with a 90% band of the fitted mean, the observed days, revenue per conversion and the marginal return at today's spend.
POST /v1/projects/{id}/web/budget/scenario with {days, budgets?, total_budget?, optimize?, bounds?} projects conversions (with the 90% band), revenue, CPA and ROAS per key for the period. Keys without a budget plan at today's daily rate; total_budget alone scales today's mix; optimize: true splits the total (or the sum of the budgets) by marginal return in 400 increments, honouring per-key {min, max} bounds. baseline is the same total at today's mix.
Verify: cargo test -p lc-attribution paths, cargo test -p lc-stats response_curve, the web_it integration test (make it), and pnpm --filter web test paths-budget.