Skip to content

fix(growth): stop misreporting unlock_click as a dead event in the funnel - #81

Merged
lauurnce merged 1 commit into
mainfrom
fix/funnel-unlock-click
Sep 6, 2026
Merged

lauurnce merged 1 commit into
mainfrom
fix/funnel-unlock-click

Conversation

@lauurnce

@lauurnce lauurnce commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #32. `lib/reports/funnel.ts`'s own header claimed `unlock_click` "is emitted by no code since the subscription pivot" — false: `SectionRenderer.tsx` and `LockedReviewer.tsx` both still fire it live, at `/unlock`, where the price is first quoted. `lib/adminFunnel.ts` already treats it as live (removed from `DEAD_EVENT_TYPES`, charted as "Reached Unlock"); the growth funnel's own dead-event check was the only place still misreporting it.

  • `FUNNEL_STEPS` now includes `unlock_click` between `paywall_teaser_click` and `subscribe_click`, matching the live path's own order.
  • Header comment corrected.
  • New migration (`20260904000000_growth_funnel_agg_unlock_click.sql`) adds a matching windowed count to `growth_funnel_agg`'s `steps` CTE — same function signature, same `revoke`/`grant` pair as before, no new permission surface.

⚠️ Manual step required (this repo's established pattern)

This repo has no `supabase db push` workflow — every `growth_`/`admin_` aggregate is applied by hand in the Supabase Studio SQL editor. Merging this PR does not apply the migration. A verification checklist is included (`20260904000000_growth_funnel_agg_unlock_click.test.md`, mirroring the original migration's own checklist) for whoever applies it to run through, including re-confirming the anon-role permission check still rejects (the single most load-bearing check on any `growth_*` aggregate, per the original migration's own `.test.md`).

Test plan

  • `npx tsc --noEmit` clean
  • `npm run lint` clean
  • Full suite: 1666/1666 passing (updated `lib/reports/funnel.test.ts` for the new step: order, dead-event exclusion split into unlock_click-is-live vs. unlock_submitted-still-dead, and every fixture that builds a full counts object)
  • Migration applied to production Supabase + its `.test.md` checklist run through (manual, by the repo owner)

…nnel

FUNNEL_STEPS's own header claimed unlock_click "is emitted by no code
since the subscription pivot" -- false: SectionRenderer.tsx and
LockedReviewer.tsx both still fire it live, at /unlock, where the price
is first quoted. lib/adminFunnel.ts already treats it as live (removed
from DEAD_EVENT_TYPES, charted as "Reached Unlock"); the growth
funnel's own dead-event check was the only place still misreporting it.

Adds unlock_click to FUNNEL_STEPS between paywall_teaser_click and
subscribe_click (the live path's own order), corrects the header, and
adds a matching windowed count to growth_funnel_agg's steps CTE via a
new migration -- same signature, same permissions, no new grant.

Closes #32.
@vercel

vercel Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
survival-kit-app Ready Ready Preview Sep 6, 2026 2:17pm UTC

@lauurnce
lauurnce merged commit fc5d953 into main Sep 6, 2026
2 of 4 checks passed
@lauurnce
lauurnce deleted the fix/funnel-unlock-click branch September 6, 2026 14:17

This branch was successfully deployed

1 active deployment
Preview — 51b41a2f Deployed Sep 6, 2026 by vercel[bot]
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.

Growth funnel is blind to unlock_click; dead-event check misreports it as dead

1 participant