AstroBaaS

Tax & compliance

Funnel Analysis

Free — GPL coresize Lplanned, not built

Generated from docs/plan/core/funnel-analysis/PLAN.md in the AstroBaaS repository. Nothing described below is implemented — it is the written plan for it.

A core feature providing deep analysis of customer journeys through the conversion funnel: segment abandoners by product/device/location, identify bottleneck steps, compare funnel performance week-over-week, and visualize where friction exists with actionable insights.

The problem

A Greek merchant’s checkout funnel is leaky. She knows 40% of visitors abandon at the payment-method step. But she doesn’t know: Is it mobile users only? Desktop? Specific payment methods? Does Germany abandon more than Italy? She’s blind—can’t optimize without data.

What it does

  • Funnel segmentation: slice funnel by product, device (mobile/desktop/tablet), country, payment method, traffic source
  • Bottleneck detection: auto-identify which step has highest drop-off; highlight in red
  • Week-over-week comparison: show if funnel improved or worsened this week vs last week
  • Step performance: for each funnel step, show conversion rate + time to complete
  • Device-specific analysis: mobile users convert at 1.5%, desktop at 3%—identify and fix mobile friction
  • Geographic heatmap: which countries have lowest conversion rates? (highlight red/yellow/green)
  • Payment-method analysis: which payment method has highest abandon rate? (Stripe vs PayPal vs Apple Pay)
  • Product-specific funnels: does the Red Dress sell better than the Blue Dress? (compare funnel for each product)
  • Recommendations: ‘Mobile checkout is 50% slower than desktop—optimize for mobile’
  • Export: funnel data can be exported as CSV for further analysis

What it deliberately does NOT do

Each boundary carries its reason. A boundary without a reason gets crossed by the next person who reads this.

  • Session replay (showing which exact page elements users clicked)—privacy too high
  • Heatmaps (visual click density maps)—privacy/performance concern
  • Automated A/B testing—separate feature
  • Email or SMS abandonment campaigns—separate email marketing feature
  • Predictive models (‘forecast next week’s conversion rate’)—out of scope

Data model

Extend ConversionEvent with: device_type, country_code, payment_method_name, traffic_source, product_category. No core migration; all stored in ConversionEvent table.

API

  • GET /funnel-analysis/segment/:segment_type/:value — e.g., /segment/device/mobile
  • GET /funnel-analysis/comparison/:period1/:period2 — compare two weeks
  • GET /funnel-analysis/bottleneck — return step with highest drop-off
  • GET /funnel-analysis/by-product/:productId — funnel for single product only
  • GET /funnel-analysis/by-country/:countryCode — funnel for single country
  • GET /funnel-analysis/time-distribution — histogram of time spent on each step

Every route added here must also appear in src/pages/openapi.json.ts — a test fails the build if it does not.

Admin

Funnel dashboard: main funnel (all users), + tabs for each segment (mobile/desktop/by-country/by-payment-method). Each shows step-by-step conversion rate, time to complete, week-over-week trend. Bottleneck step highlighted in red. Heatmap: countries with lowest conversion (red countries stand out). Recommendations sidebar (‘Mobile is 50% slower’).

The seam — why this is core

Core owns: event logging, data storage. Paid pack owns: segmentation engine, trend analysis, geographic heatmap, AI-driven recommendations.

Core owns the interface + honest funnel tracer; analytics is infrastructure, not a per-country obligation or credential.

Dependencies

  • conversion-tracking (core; must track events first)
  • ConversionEvent schema (device_type, country_code, payment_method fields must exist)

Acceptance checks

Each of these must be able to fail. Before claiming this is done, break the code deliberately and watch each one go red.

  • Funnel segmented by device shows: mobile 500 views → 200 cart (40%) → 50 checkout (25%) → 10 orders (20%); desktop 500 views → 400 cart (80%) → 150 checkout (37.5%) → 50 orders (33%)
  • Mobile converts at 2%, desktop at 10%—mobile bottleneck is visibly red in dashboard
  • Comparing week Sept 1-7 to Sept 8-14 shows conversion improved 3% → 3.5% (green trending up)
  • Bottleneck detection shows ‘Payment Method Step: 80% abandon rate’ (highest drop-off)
  • Payment-method analysis: Stripe 2% abandon, PayPal 25% abandon—PayPal highlighted in red
  • Product-specific funnel for ‘Red Dress’ shows 5% conversion; ‘Blue Dress’ shows 2%
  • Geographic heatmap shows Germany 3%, Greece 2.5%, France 1.5% (France in red, lowest)
  • Exporting funnel data as CSV includes: step_name, completion_rate, avg_time_seconds, segment, segment_value

Risks

Funnel segmentation by too many dimensions (5+ segments) creates sparse data—segments with <50 users are unreliable. Bottleneck algorithm might flag random noise as bottleneck (e.g., 1-user segment with 100% drop). If recommendations are too noisy (‘fix mobile’ weekly even though it’s fine), merchants stop reading them. Geographic data too granular (ZIP code level) = privacy risk.

Commercial context

Suggested pricefree (core)
Rival anchorShopify: included (GA4); Magento: included

The anchor is what the nearest equivalent charges on Shopify or Magento today. It is context for a pricing decision, not the decision.


Generated from the commerce plan. See docs/COMMERCE-PLAN.md for the full catalogue and ../../AI-GUIDE.md for how to work on this repository.