Skip to content

feat(telemetry): add CLI onboarding funnel events#1286

Merged
even-wei merged 4 commits into
mainfrom
feature/drc-3197-implement-telemetry-for-onboarding-flow
Apr 10, 2026
Merged

feat(telemetry): add CLI onboarding funnel events#1286
even-wei merged 4 commits into
mainfrom
feature/drc-3197-implement-telemetry-for-onboarding-flow

Conversation

@wcchang1115
Copy link
Copy Markdown
Collaborator

@wcchang1115 wcchang1115 commented Apr 10, 2026

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?

Feature

What this PR does / why we need it:

Implements 8 Amplitude telemetry events to track conversion at each step of the Cloud onboarding funnel:

Event Trigger
oss_share_button_clicked Share button clicked (authed & non-authed)
signup_redirect_initiated handleSignup opens Cloud tab
signup_completed Auth detected, popover shows "reload"
artifact_upload_started User clicks Upload in dialog
redirect_to_cloud_session window.open(sessionUrl) fires
dw_setup_shown Dialog enters dw_setup state
dw_setup_completed handleDwSetup succeeds
dw_setup_skipped handleSkipDw called

All events use the [CLI Onboarding] category prefix.

Which issue(s) this PR fixes:

Special notes for your reviewer:

  • No backend changes — all events are frontend-only via existing Amplitude track() utility
  • Three files changed: track.ts (event definitions), CloudShareButtonOss.tsx (3 events), CloudUploadDialogOss.tsx (5 events)

Does this PR introduce a user-facing change?:

NONE

wcchang1115 and others added 4 commits April 10, 2026 08:57
Implement 8 Amplitude telemetry events to track conversion through the
Cloud onboarding flow: share button click, signup redirect/completion,
artifact upload, cloud redirect, and DW setup shown/completed/skipped.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
Distinguish between authed and non-authed users clicking the share
button so the onboarding funnel can be segmented in Amplitude.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Wei-Chun, Chang <wcchang@infuseai.io>
@wcchang1115 wcchang1115 marked this pull request as ready for review April 10, 2026 09:11
@wcchang1115 wcchang1115 self-assigned this Apr 10, 2026
@wcchang1115 wcchang1115 requested a review from even-wei April 10, 2026 09:31
@even-wei
Copy link
Copy Markdown
Contributor

Code Review: PR #1286

Reviewer: Claude Code (automated)
Files reviewed: 3
Categories: Frontend (tracking definitions + component integrations)
Passes run: A, B, C, D, E, F, G, H

Validation Results

Pass A: Correctness & Logic — PASS

All 8 tracking events are correctly placed at the intended funnel steps:

Event Location Verified
oss_share_button_clicked CloudShareButtonOss.tsx:67 (authed), :92 (non-authed) authed boolean correctly reflects auth state
signup_redirect_initiated CloudShareButtonOss.tsx:104 ✅ Fires before connectToCloud call
signup_completed CloudShareButtonOss.tsx:38 ✅ Fires after fetchUser succeeds in checkAuth
artifact_upload_started CloudUploadDialogOss.tsx:143 ✅ Fires before uploadToCloud call
dw_setup_shown CloudUploadDialogOss.tsx:167 ✅ Fires when entering dw_setup state
dw_setup_completed CloudUploadDialogOss.tsx:235 ✅ Fires after successful setupWarehouse
dw_setup_skipped CloudUploadDialogOss.tsx:252 ✅ Fires in handleSkipDw
redirect_to_cloud_session CloudUploadDialogOss.tsx:173,238,255 ✅ Fires before every window.open(sessionUrl)

No logic inversions, off-by-ones, or missing edge cases.

Pass B: Security — PASS

  • No PII, secrets, or user-identifiable data flows into tracking calls
  • Only a boolean (authed) is passed as event properties
  • No injection vectors

Pass C: Cross-Reference Consistency — PASS

  • All 8 functions exported from track.ts match their imports in both consumer files
  • trackOssShareButtonClicked({ authed: boolean }) signature matches both call sites ({ authed: true } and { authed: false })
  • All zero-arg functions called correctly without arguments

Pass D: Error Handling & Edge Cases — PASS

  • All tracking calls are fire-and-forget (return value ignored), consistent with every other tracking function in track.ts
  • The base track() function gracefully falls back to console.log when Amplitude isn't initialized — no crash possible
  • No new error paths introduced

Pass E: Test Coverage & Quality — PASS (with note)

No new tests added, but this is consistent with the existing pattern — none of the 15+ existing tracking functions in track.ts have dedicated tests. The functions are thin wrappers over the Amplitude SDK with no branching logic.

Pass F: Diff-Specific Checks — PASS

  • The single deletion (line 63 of CloudShareButtonOss.tsx) correctly replaces inline onClick with a block that adds trackOssShareButtonClicked before the existing setShowUploadDialog(true) — behavior preserved
  • All other changes are purely additive (new imports, new definitions, new calls)
  • PR description accurately matches the implemented events

Pass G: Performance — PASS

No performance concerns. All tracking calls are synchronous fire-and-forget to the Amplitude SDK, which batches network requests internally.

Pass H: Async/Concurrency — PASS

All tracking calls are synchronous and placed before async operations (upload, setup, auth check). No missing awaits, no race conditions.

Verification Results

Check Result
Biome lint (3 changed files) ✅ Clean — no fixes needed
TypeScript type check ⚠️ Pre-existing failure in excel.test.ts:16 (on main) — not introduced by this PR
Frontend tests (Vitest) ⚠️ 14 pre-existing failures in excel.test.ts (on main) — not introduced by this PR

Verdict: GO

All validation passes clean. The PR is a focused, well-placed addition of 8 Amplitude tracking events to the CLI onboarding funnel. No critical issues found.

Copy link
Copy Markdown
Contributor

@even-wei even-wei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review: No critical issues found. All 8 onboarding funnel events correctly placed.

@even-wei even-wei merged commit 82b7a6e into main Apr 10, 2026
7 checks passed
@even-wei even-wei deleted the feature/drc-3197-implement-telemetry-for-onboarding-flow branch April 10, 2026 09:43
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.

2 participants