Skip to content

feat(analytics): show the shopper funnel - #10

Merged
PhilippTheServer merged 1 commit into
mainfrom
pl/storefront-funnel
Aug 26, 2026
Merged

PhilippTheServer merged 1 commit into
mainfrom
pl/storefront-funnel

Conversation

@PhilippTheServer

Copy link
Copy Markdown
Contributor

Closes #9 · completes S2 with OpenTaberna/fastapi#47 and OpenTaberna/frontend#3

Adds the shopper funnel to the Analytics page: sessions → product views → carts → checkouts
→ paid, plus top traffic paths and per-SKU view-to-cart rate.

Two things the page has to be honest about

The steps are not equally trustworthy. Everything before paid comes from what browsers
reported and is a floor — blocked scripts and closed tabs lose events. paid is read
from the orders table and is exact. So they are drawn in different colours, the paid row
carries an exact badge, and a note says real conversion is no worse than shown.

Presented as one continuous measurement, a funnel that undercounts its first step but not
its last overstates the drop — which would make the shop look worse than it is and send
someone off optimising a problem that isn't there.

Off is not the same as empty. When collection is disabled the page says so and names the
setting, instead of rendering a funnel of zeroes. An operator staring at an empty chart
deserves to know whether nobody visited or nobody counted.

"Looked at, not taken"

Ranks products viewed by several shoppers and added by fewer than half. This is the figure
sales data cannot produce, because sales data only ever contains what did sell — a listing
that attracts people and then loses them is invisible in it.

Products with a single viewer are excluded: one person is not evidence.

Verification

$ npx ng test --watch=false
 Test Files  9 passed (9)
      Tests  59 passed (59)

$ npx prettier --check "src/app/**/*.{ts,html}"
All matched files use Prettier code style!

$ npx ng build
Initial total | 345.98 kB | 93.47 kB

Six new tests, each pinning a way this could mislead: the paid step is coloured differently
from the rest, a well-converting product is not flagged as leaking, a one-viewer product is
not flagged either, a disabled deployment reports storefrontOff() rather than an empty
chart, and a failing panel flags the partial view without blanking the page.

The API returns the journey before an order exists and the storefront reports
it, but nothing displayed any of it.

Adds the shopper funnel to the Analytics page: sessions through product views,
carts and checkouts to paid, plus top traffic paths and per-SKU view-to-cart
rate.

Two things the page has to be honest about.

The pre-order steps come from what browsers reported and are a floor: blocked
scripts and closed tabs lose events. The paid step is read from the orders table
and is exact. They are drawn in different colours, the paid row carries an
"exact" badge, and a note says real conversion is no worse than shown. Presented
as one continuous measurement, a funnel that undercounts its first step and not
its last overstates the drop.

When collection is off the page says so, rather than rendering an empty funnel.
"Nobody visited" and "we are not counting" look identical otherwise, and an
operator staring at zeroes deserves to know which they are looking at.

"Looked at, not taken" ranks products viewed by several shoppers and added by
fewer than half. That is the figure sales data cannot produce, because sales
data only ever contains what did sell. Products with a single viewer are
excluded — one person is not evidence.

Closes #9

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YY1ekLLeFLkAU2kvdQ8Ey4
@PhilippTheServer
PhilippTheServer merged commit 0d918f9 into main Aug 26, 2026
1 check passed
@PhilippTheServer
PhilippTheServer deleted the pl/storefront-funnel branch August 26, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The shopper funnel is collected but not shown

1 participant