-
Notifications
You must be signed in to change notification settings - Fork 673
feat(telemetry): instrument cloud funnel gaps (auth, onboarding, canvas, output) #12894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
151b667
feat(telemetry): instrument cloud funnel gaps (auth, onboarding, canv…
deepme987 68cd6c8
[automated] Apply ESLint and Oxfmt fixes
actions-user 938609b
test(telemetry): positive-path + behavioral tests for the cloud funne…
deepme987 2cda397
refactor(telemetry): address review on the cloud funnel events
deepme987 7da664a
feat(telemetry): add funnel-completion events + context super-properties
deepme987 8fe6159
feat(website): add explicit homepage CTA telemetry
deepme987 ad65486
feat(telemetry): fire subscribe-now click from real tier CTAs
deepme987 5f789e1
[automated] Apply ESLint and Oxfmt fixes
actions-user f303872
feat(telemetry): track monthly/yearly billing-cycle toggle on pricing…
deepme987 ffd37e8
feat(telemetry): add auth_error + template_category events; enable cl…
deepme987 cefe24a
Merge remote-tracking branch 'origin/main' into deepme987/frontend/cl…
deepme987 631bab4
Merge remote-tracking branch 'origin/deepme987/feat/cloud-funnel-tele…
deepme987 2338efc
Merge remote-tracking branch 'origin/deepme987/feat/website-cta-telem…
deepme987 464f383
fix(telemetry): resolve consolidation follow-ups
deepme987 b7f0acc
[automated] Apply ESLint and Oxfmt fixes
actions-user e680a68
docs(telemetry): trim verbose comments to repo norm (1-2 lines)
deepme987 bb4f31c
Merge origin/main into deepme987/frontend/cloud-funnel-telemetry
deepme987 ecf30e0
chore: revert incidental Tailwind class reorders in website CTA compo…
deepme987 08a0136
test(telemetry): cover new registry funnel-event dispatch methods
deepme987 a2b2352
chore: re-trigger CI
deepme987 b70b862
Merge origin/main into deepme987/frontend/cloud-funnel-telemetry
deepme987 b8db435
Merge origin/main into deepme987/frontend/cloud-funnel-telemetry
deepme987 4b73a70
Merge branch 'main' into deepme987/frontend/cloud-funnel-telemetry
deepme987 f4b1c19
fix(telemetry): correct auth-funnel + run-gate event accuracy (review)
deepme987 fe9cb9d
docs(telemetry): cut over-commenting to repo terse norm
deepme987 2b27182
Merge remote-tracking branch 'origin/main' into deepme987/frontend/cl…
deepme987 147c4f4
refactor(telemetry): drop FE-inferred subscription-success event and …
deepme987 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,8 @@ import { | |
| getSurveyCompletedStatus, | ||
| getUserCloudStatus | ||
| } from '@/platform/cloud/onboarding/auth' | ||
| import { isCloud } from '@/platform/distribution/types' | ||
| import { useTelemetry } from '@/platform/telemetry' | ||
|
|
||
| import CloudLoginViewSkeleton from './skeletons/CloudLoginViewSkeleton.vue' | ||
| import CloudSurveyViewSkeleton from './skeletons/CloudSurveyViewSkeleton.vue' | ||
|
|
@@ -42,6 +44,7 @@ const { flags } = useFeatureFlags() | |
| const onboardingSurveyEnabled = computed( | ||
| () => flags.onboardingSurveyEnabled ?? true | ||
| ) | ||
| const telemetry = isCloud ? useTelemetry() : undefined | ||
|
|
||
| const skeletonType = ref<'login' | 'survey' | 'waitlist' | 'loading'>('loading') | ||
|
|
||
|
|
@@ -54,6 +57,11 @@ const { | |
| await nextTick() | ||
|
|
||
| if (!onboardingSurveyEnabled.value) { | ||
| telemetry?.trackOnboardingRouted({ | ||
| destination: 'onboarded', | ||
| survey_completed: false, | ||
| has_cloud_status: false | ||
| }) | ||
| await router.replace({ path: '/' }) | ||
| return | ||
| } | ||
|
|
@@ -65,19 +73,34 @@ const { | |
|
|
||
| // Navigate based on user status | ||
| if (!cloudUserStats) { | ||
| telemetry?.trackOnboardingRouted({ | ||
| destination: 'waitlist', | ||
| survey_completed: !!surveyStatus, | ||
| has_cloud_status: false | ||
| }) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is necessary as the waitlist doesn't exist anymore. |
||
| skeletonType.value = 'login' | ||
| await router.replace({ name: 'cloud-login' }) | ||
| return | ||
| } | ||
|
|
||
| // Survey is required for all users when feature flag is enabled | ||
| if (!surveyStatus) { | ||
| telemetry?.trackOnboardingRouted({ | ||
| destination: 'survey', | ||
| survey_completed: false, | ||
| has_cloud_status: true | ||
| }) | ||
| skeletonType.value = 'survey' | ||
| await router.replace({ name: 'cloud-survey' }) | ||
| return | ||
| } | ||
|
|
||
| // User is fully onboarded (active or whitelist check disabled) | ||
| telemetry?.trackOnboardingRouted({ | ||
| destination: 'onboarded', | ||
| survey_completed: true, | ||
| has_cloud_status: true | ||
| }) | ||
| globalThis.location.href = '/' | ||
| }), | ||
| null, | ||
|
|
||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /** | ||
| * Bridges the auth -> canvas gap for the `canvas_ready` activation event. | ||
| * | ||
| * The onboarded path navigates with a full `location.href` reload, which wipes | ||
| * in-memory state (including the auth store) before the graph canvas mounts. | ||
| * `auth_completed` therefore cannot carry forward whether the user was new or | ||
| * when they authenticated. We stash a small marker in `sessionStorage` at auth | ||
| * completion and consume it exactly once when the canvas first becomes | ||
| * interactive. sessionStorage is per-tab and cleared on tab close, which is the | ||
| * correct scope for a single activation. | ||
| */ | ||
| const MARKER_KEY = 'comfy:telemetry:auth-activation' | ||
|
|
||
| interface AuthActivationMarker { | ||
| at: number | ||
| isNewUser: boolean | ||
| } | ||
|
|
||
| /** Records that an authentication just completed, for the next canvas load. */ | ||
| export function markAuthForActivation(isNewUser: boolean): void { | ||
| try { | ||
| const marker: AuthActivationMarker = { at: Date.now(), isNewUser } | ||
| sessionStorage.setItem(MARKER_KEY, JSON.stringify(marker)) | ||
| } catch { | ||
| // sessionStorage may be unavailable (private mode, SSR); skip silently. | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Reads and clears the activation marker. Returns null when no auth happened in | ||
| * this tab (e.g. a plain reload by a returning user). | ||
| */ | ||
| export function consumeAuthActivation(): AuthActivationMarker | null { | ||
| try { | ||
| const raw = sessionStorage.getItem(MARKER_KEY) | ||
| if (!raw) return null | ||
| sessionStorage.removeItem(MARKER_KEY) | ||
| const parsed: unknown = JSON.parse(raw) | ||
| if ( | ||
| parsed && | ||
| typeof parsed === 'object' && | ||
| typeof (parsed as AuthActivationMarker).at === 'number' && | ||
| typeof (parsed as AuthActivationMarker).isNewUser === 'boolean' | ||
| ) { | ||
| return parsed as AuthActivationMarker | ||
| } | ||
| } catch { | ||
| // Corrupt or unavailable; treat as no marker. | ||
| } | ||
| return null | ||
| } |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should stay consistent with the rest of the codebase and just inline all useTelemetry calls. The performance diff is not detectable and generally we should avoid eager import side effects.