feat: custom analytics events for pricing CTAs and valuation funnel - #57
feat: custom analytics events for pricing CTAs and valuation funnel#57sweetmantech wants to merge 1 commit into
Conversation
recoupable.dev had @vercel/analytics mounted but emitted zero custom events, so the marketing funnel was unmeasurable. Adds a thin, tested trackEvent wrapper (swallows errors so analytics can never break the page) and wires five funnel events: pricing_cta_clicked (per plan), valuation_artist_selected, valuation_run, valuation_completed (tracks_measured + duration_ms), and open_app_clicked. Purely additive: no hrefs, copy, or styling change. Part of recoupable/chat#1902 (M3). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
recoupable.dev has
@vercel/analyticsmounted (<Analytics />inapp/layout.tsx) but emitted zero custom events, so the marketing funnel was unmeasurable. This PR adds a thin, testedtrackEventwrapper and wires five client-side funnel events. Purely additive: no hrefs, copy, or styling changed.Part of recoupable/chat#1902 (M3).
Events
pricing_cta_clickedplan:plus|pro|partner|freevaluation_artist_selectedartist_name(public artist name)valuation_runPOST /api/valuationrun starts (fires per run, including deferred post-login auto-runs)valuation_completedtracks_measured,duration_msopen_app_clickedNotes:
free/pro/partner; the live pricing copy has no "free" plan card — the plans areplus/pro/partner(lib/copy/pricing.ts), so plan-card events carry the real plan ids and the bottom "Get started free" CTA reportsfree.duration_msshipped: it's measured locally inside the run function (startedAtat POST start), no state threading needed.How
lib/analytics/trackEvent.ts— single exported function forwarding to@vercel/analyticstrack, swallowing errors so a blocked/failed beacon can never break the page. TDD:lib/analytics/__tests__/trackEvent.test.ts(mocked@vercel/analytics; asserts forwarding with and without props, and error swallowing) written first and confirmed red before the implementation.components/pricing/PricingCtaLink.tsx— client anchor wrapper so the server-rendered pricing page can attachonClickwithout changing the anchor's href, copy, or classes.components/valuation/CatalogValuation.tsx(select) andhooks/useCatalogValuation.ts(run/completed), so deferred post-login runs are counted too.Verify in Web Analytics
POST /_vercel/insights/eventrequests fire in the Network tab on each interaction.Test + build
pnpm exec vitest run— 6 files, 20 tests passed (3 new).pnpm exec tsc --noEmit— clean.pnpm build— passes (local run needs a cuid-shapedNEXT_PUBLIC_PRIVY_APP_ID; unrelated to this change).Preview verification to follow in a PR comment.
🤖 Generated with Claude Code
Summary by cubic
Adds custom analytics events to measure pricing CTAs and the valuation funnel using
@vercel/analytics. Implements a safetrackEventwrapper and wires five events to meet Linear 1902 (M3) marketing analytics goals.trackEventwrapper around@vercel/analyticstrack; swallows errors; unit tests added.pricing_cta_clicked(plan id),valuation_artist_selected(artist_name),valuation_run,valuation_completed(tracks_measured, duration_ms),open_app_clicked.Written for commit 361cdef. Summary will update on new commits.