Repository navigation
feat(analytics): show the shopper funnel - #10
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
paidcomes from what browsersreported and is a floor — blocked scripts and closed tabs lose events.
paidis readfrom the orders table and is exact. So they are drawn in different colours, the paid row
carries an
exactbadge, 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
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 emptychart, and a failing panel flags the partial view without blanking the page.