Repository navigation
feat(analytics): instrument 4-stage Plausible funnel (Input -> Conversion -> Export) - #226
Merged
obvious-autobuild-staging[bot] merged 1 commit intoOct 19, 2026
Conversation
…sion -> Export)
- Emit Stage 2 `Input` (`input` on gtag, `Input` on Plausible) with `{ direction, input, size, valid }` on settled and discrete non-empty data provision (even when `valid === false`), while keeping `Conversion` strictly gated on `valid === true`.
- Separate `Try an example` (`input: "example"`) and direction switches (`input: "flip"`) from clipboard pastes (`input: "paste"`).
- Enrich `Export` with `pane: "output" | "input"` and `direction: "csv_to_json" | "json_to_csv"`, and track `CsvTable` selection copies (`Copy as CSV` chip + `Cmd/Ctrl+C`) and native `Cmd/Ctrl+C` copies inside `OutputPane`.
- Expand unit and integration tests in `events.test.ts` and `App.test.tsx` and rebuild `app/dist`.
Co-authored-by: David Boskovic <[email protected]>
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.
Why
Previously, CSVJSON's analytics funnel had four blind spots between page landing and output egress:
Conversiononly fired whenisValid(direction, text) === true, so malformed pastes or uploads emitted zero events — making it impossible to separate visitors who never provided data from visitors whose data failed parsing.tracker.edit(...)(tagging sample clicks asinput: "paste"), while clicking the direction switch (handleFlip) emitted no tracker event at all.Exportemitted only{ via, format }, conflating Input-pane copies/downloads with Output-pane egress.Cmd/Ctrl+Cinside the JSON output editor) and grid selection copies (Copy as CSVchip orCmd/Ctrl+CinCsvTable) never triggeredtrackExport.What
Implements AC-10 and Locked Decision D9 from Blueprint
art_MJHTha6Xand Plausible runbookart_vUXl76He:gtagEventpageviewscript.manual.js)Input/inputdirection,input(paste|file|drag|permalink|example|flip),size,valid(boolean)valid === false), deduplicated by signature & 2s windowConversion/conversiondirection,input,sizevalid === true) — 100% backward-compatible with existing goalExport/exportvia(copy|download),format(json|csv),pane(output|input),directionCsvTableselection copy (Copy as CSVchip +Cmd/Ctrl+C), and nativeCmd/Ctrl+CinsideOutputPaneTradeoffs
Inputdeduplication state vs. sharedConversionstate:createConversionTrackertrackslastInputSignatureandlastInputFiredAtseparately fromlastSignature/lastFiredAtso an invalid input recordsInput (valid: false)without burning theConversionwindow when the user subsequently fixes the syntax error.ExportProps:paneanddirectionare optional onExportPropsand omitted when undefined so existing minimal callers continue to work unchanged whileApp.tsxsupplies full{ via, format, pane, direction }context on every egress path.verify-seo.sh.How to Review
app/src/analytics/events.ts—InputProps,trackInput, expandedConversionInput(example,flip),ExportProps(pane,direction), and 2-stageattemptFireincreateConversionTracker.app/src/App.tsx—onTryExample(tracker.discrete(..., "example", sample)),handleFlip(tracker.discrete(..., "flip", nextInput)), enrichedtrackExportcalls, and tracker cleanup on unmount.app/src/components/CsvTable.tsx,app/src/components/InputPane.tsx,app/src/components/OutputPane.tsx—onCopySelectionandonNativeCopywiring.app/src/analytics/events.test.ts&app/src/App.test.tsx— unit and end-to-end component tests across all 4 funnel stages.Verification
cd app && npm run lint && npx tsc -b --noEmit && npm test(30 test files, 525 tests passing)cd app && npm run build(app/distrebuilt and committed in parity)bash .github/scripts/verify-seo.sh(passed)Human author: David Boskovic ([email protected])
🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact