Skip to content

Funnel visibility: landing-page + traffic-source metrics#67

Merged
New1Direction merged 1 commit into
mainfrom
feat/funnel-visibility
Jun 10, 2026
Merged

Funnel visibility: landing-page + traffic-source metrics#67
New1Direction merged 1 commit into
mainfrom
feat/funnel-visibility

Conversation

@New1Direction

Copy link
Copy Markdown
Owner

Why

We have a traffic spike (~25k page views) with ~0 signups and couldn't tell where the traffic lands or comes from — the existing funnel counters only measured actions (u_view, checkout_started, paid), not arrival page or referrer. Diagnosing capture was blind.

What

A fire-and-forget GET middleware records two KV daily dimensions:

  • land:<page>:<day> — arrival-page bucket (home/drops/guides/leaderboard/grade/u/pricing/…)
  • ref:<source>:<day>utm_source/source tag → else Referer host (mapped to google/bing/reddit/x/tiktok/youtube/chatgpt/… or eTLD+1) → bot UA → bot so the crawler share of the visitor number is separable.

Surfaced in GET /api/v1/admin/metrics as landing + sources rollups, and readable straight from the land:/ref: KV counters.

Safety

  • Additive only; trackView no-ops on assets/API and can never throw into the request path.
  • Separate key prefixes — the existing event funnel rollup is untouched.
  • New pure-bucketer tests (metrics_dims.test.ts, 7 cases). Full suite 255+7 green, typecheck clean.

🤖 Generated with Claude Code

…k land/come from)

The event funnel measured what visitors DID but not where they LANDED or came
FROM — so a traffic spike with 0 signups was undiagnosable. Add two KV daily
dimensions written by a fire-and-forget GET middleware:
  land:<page>:<day>  — arrival page bucket (home/drops/guides/leaderboard/u/...)
  ref:<source>:<day> — utm_source/Referer host, with bot UA → "bot" so we can
                       separate real humans from crawlers in the visitor count.
Surfaced in GET /api/v1/admin/metrics (landing/sources rollups) and readable
straight from KV. Pure bucketers covered by metrics_dims.test.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@New1Direction New1Direction merged commit 54ab299 into main Jun 10, 2026
1 check passed
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.

1 participant