Skip to content

feat(telemetry): instrument cloud funnel gaps + enable cloud web analytics - #12935

Closed
deepme987 wants to merge 3 commits into
mainfrom
deepme987/feat/cloud-funnel-telemetry-gaps
Closed

feat(telemetry): instrument cloud funnel gaps + enable cloud web analytics#12935
deepme987 wants to merge 3 commits into
mainfrom
deepme987/feat/cloud-funnel-telemetry-gaps

Conversation

@deepme987

Copy link
Copy Markdown
Contributor

Summary

Closes the cloud funnel-telemetry gaps from the funnel audit: subscribe-click coverage, billing-cycle toggle, auth errors, template-category selection, and enabling web analytics (heatmaps / $pageview) on cloud.comfy.org.

Changes

  • What:
    • Subscribe-click coverageapp:subscribe_now_button_clicked now fires from the real tier CTAs in PricingTable.vue (handleSubscribe, new + change) and SubscribeToRun.vue, not only SubscribeButton.vue. Previously the event undercounted vs actual conversions because the forced post-signup pricing modal's tier buttons never fired it.
    • Billing-cycle toggle — new app:billing_cycle_toggled {from,to} on the monthly/yearly switch (today ~96% pick monthly, ~4% annual, yearly is default — we had no visibility into the toggle).
    • Auth errors — new app:auth_error {method,is_sign_up,error_code,error_message} on the sign-in/up failure path (the signup leak that success-only app:user_auth_completed can't see).
    • Template category — new app:template_category_selected {category_id} when the user switches tab/category (e.g. Getting Started vs All) in the template selector.
    • Cloud web analytics — enable autocapture, capture_pageview, capture_pageleave, and heatmaps in the cloud app's posthog-js init. cloud.comfy.org currently emits zero $pageview/autocapture, so the login/onboarding pages have no heatmaps and there is no on-site sourcing.
  • Breaking: none.

Review Focus

  • Web-analytics enablement (volume + consent): this turns on autocapture + pageviews + heatmaps for the cloud app for the first time. It stays consent-gated like the rest of telemetry, and autocapture does not record input values (posthog masks them). Please sanity-check the data-volume implications and that nothing sensitive is captured. The hardcoded defaults remain overridable per-environment via the server posthog_config (spread after them), so this can be tuned or disabled remotely without a deploy.
  • SPA pageviews: relying on posthog-js history-based $pageview capture — worth confirming route-change pageviews actually fire on the Vue SPA (add a router afterEach hook if not).
  • Not included (scoped follow-up): populating the paywall reason on app:subscription_required_modal_opened (it arrives empty in prod). useSubscriptionDialog already threads a reason into the dialog, but the modal_opened event and the ~10 showSubscriptionDialog call-sites don't pass it, and the reason taxonomy (subscription_required / out_of_credits / top_up_blocked) needs a product decision on what to track — left out deliberately.

Companion PRs

app:subscribe_now_button_clicked was only fired by the legacy
SubscribeButton, never by the pricing table tier buttons or the
subscribe-to-run lock button - the surfaces users actually click. Add
the same trackSubscription('subscribe_clicked') capture to:

- PricingTable.handleSubscribe (both the new-subscriber and plan-change
  paths), before checkout opens, carrying { tier, cycle }
- SubscribeToRun.handleSubscribeToRun, alongside the existing run-button
  event

Each surface now tags a source ('pricing_table' | 'subscribe_to_run' |
'subscribe_button') so the subscribe-click funnel can be attributed by
CTA. Extend SubscriptionMetadata with tier/cycle/source; no new event
name.
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Three new telemetry event types are defined (billing_cycle_toggled, auth_error, template_category_selected), with corresponding dispatch methods added to TelemetryRegistry and PostHogTelemetryProvider. The subscribe_clicked event is extended with source, tier, and cycle attribution fields. Call sites are wired in PricingTable, SubscribeButton, SubscribeToRun, authStore, and WorkflowTemplateSelectorDialog. PostHog's default init configuration is changed to enable autocapture, pageview, pageleave, and heatmaps tracking.

Changes

Telemetry Expansion

Layer / File(s) Summary
Telemetry type contracts and event constants
src/platform/telemetry/types.ts
SubscribeClickSource union and optional tier/cycle/source fields added to SubscriptionMetadata; new BillingCycleToggledMetadata, AuthErrorMetadata, and TemplateCategorySelectedMetadata interfaces; three optional methods added to TelemetryProvider; three new TelemetryEvents constants; TelemetryEventProperties union extended.
TelemetryRegistry dispatchers and PostHog provider
src/platform/telemetry/TelemetryRegistry.ts, src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.ts, src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts
Three new TelemetryRegistry dispatcher methods forward metadata to providers via optional chaining. PostHogTelemetryProvider implements the three methods and maps them to PostHog capture calls. PostHog init defaults changed to enable autocapture, capture_pageview, capture_pageleave, and heatmaps.
Subscribe-click funnel and billing cycle toggle
src/platform/cloud/subscription/components/PricingTable.vue, src/.../PricingTable.test.ts, src/.../SubscribeButton.vue, src/.../SubscribeToRun.vue, src/.../SubscribeToRun.test.ts
PricingTable watches currentBillingCycle to emit billing_cycle_toggled and fires subscribe_clicked with tier/cycle/source in handleSubscribe. SubscribeButton adds source: 'subscribe_button'. SubscribeToRun adds subscribe_clicked with source: 'subscribe_to_run' alongside existing run button tracking. Tests cover all paths including suppression cases.
Auth error and template category call sites
src/stores/authStore.ts, src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
executeAuthAction conditionally emits trackAuthError on Cloud failures for email/google/github flows; all four auth actions pass provider and sign-up metadata. WorkflowTemplateSelectorDialog watches selectedNavItem to emit trackTemplateCategorySelected on tab changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

size:L, released:cloud, cloud/1.45

Suggested reviewers

  • thedatalife
  • AustinMroz

Poem

🐇 Hop, hop, I track each click and switch,
When billing cycles toggle — I don't glitch!
Auth errors caught with provider and sign,
Template tabs watched down every vine.
The funnel is full, the events align,
PostHog now sees what once was blind! 🎯

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main changes: adding telemetry instrumentation for cloud funnel gaps and enabling cloud web analytics.
Description check ✅ Passed The description comprehensively covers all required sections with clear details on what changed, why, and specific review focus areas aligned with the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
End-To-End Regression Coverage For Fixes ✅ Passed PR uses feature language (feat: telemetry...) not bug-fix language. This is adding telemetry events and analytics features, not fixing bugs, so end-to-end regression tests are not required.
Adr Compliance For Entity/Litegraph Changes ✅ Passed No files under src/lib/litegraph/, src/ecs/, or graph entity-related paths were modified; ADR compliance check not applicable to this telemetry-focused PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deepme987/feat/cloud-funnel-telemetry-gaps

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 06/18/2026, 12:44:06 AM UTC

Links

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

🎭 Playwright: 🕵🏻 0 passed, 0 failed

📊 Browser Reports
  • chromium: ❌ Deployment failed
  • chromium-2x: ❌ Deployment failed
  • chromium-0.5x: ❌ Deployment failed
  • mobile-chrome: ❌ Deployment failed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts (1)

101-114: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Update initialization expectations to match the new defaults

Line 110-Line 113 still assert autocapture, capture_pageview, and
capture_pageleave are false, but the provider now sets them to true.
This test will fail once the type error in the provider is fixed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts`
around lines 101 - 114, In the test for PostHog initialization (the it block
that calls posthog.init with token and default config), update the three boolean
properties in the expect.objectContaining call: change autocapture from false to
true, capture_pageview from false to true, and capture_pageleave from false to
true to match the new default values set by the provider.
src/stores/authStore.ts (1)

340-365: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Auth-error telemetry currently includes post-auth provisioning failures.

At Line 344-350, createCustomer() runs inside the same try that is caught at Line 353. If auth succeeds but customer creation fails, Line 356 still emits trackAuthError, which pollutes auth-failure analytics with downstream provisioning errors.

Proposed fix
   const executeAuthAction = async <T>(
@@
   ): Promise<T> => {
     loading.value = true
+    let result: T

     try {
-      const result = await action(auth)
+      result = await action(auth)
+    } catch (error) {
+      if (isCloud && options?.authError) {
+        useTelemetry()?.trackAuthError({
+          method: options.authError.method,
+          is_sign_up: options.authError.isSignUp,
+          error_code: (error as { code?: string })?.code,
+          error_message:
+            error instanceof Error ? error.message : String(error)
+        })
+      }
+      throw error
+    }

-      // Create customer if needed
+    try {
+      // Create customer if needed (do not classify as auth_error)
       if (options?.createCustomer) {
         const token = await getIdToken()
         if (!token) {
           throw new Error('Cannot create customer: User not authenticated')
         }
         await createCustomer()
       }

       return result
-    } catch (error) {
-      // Surface the auth failure leak that trackAuth (success-only) misses.
-      if (isCloud && options?.authError) {
-        useTelemetry()?.trackAuthError({
-          method: options.authError.method,
-          is_sign_up: options.authError.isSignUp,
-          error_code: (error as { code?: string })?.code,
-          error_message:
-            error instanceof Error ? error.message : String(error)
-        })
-      }
-      throw error
     } finally {
       loading.value = false
     }
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/stores/authStore.ts` around lines 340 - 365, The customer creation block
within the action function (lines 344-350) shares the same try-catch error
handler as the auth action call, causing createCustomer failures to incorrectly
trigger trackAuthError telemetry even when authentication succeeds. To fix this,
restructure the code by moving the customer creation logic into a separate
try-catch block that is executed after the auth action succeeds and outside the
catch block that handles authError tracking. This ensures trackAuthError only
fires for actual authentication failures from the action call, not for
downstream provisioning failures in createCustomer.
🧹 Nitpick comments (1)
src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts (1)

327-337: ⚡ Quick win

Add capture assertions for the other two new telemetry methods

This file adds coverage for trackBillingCycleToggled, but the new
trackAuthError and trackTemplateCategorySelected paths are still untested
here. Add one assertion per method to keep parity with provider changes and
reduce regression risk.
As per coding guidelines, "Write tests for all changes, especially bug fixes to catch future regressions."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts`
around lines 327 - 337, The test file PostHogTelemetryProvider.test.ts currently
has a test case for trackBillingCycleToggled but is missing test coverage for
the two other new telemetry methods: trackAuthError and
trackTemplateCategorySelected. Add two new test cases following the same pattern
as the existing trackBillingCycleToggled test - each should create a provider
instance, call the respective method with appropriate test parameters, and
assert that hoisted.mockCapture is called with the expected TelemetryEvents
constant and payload data.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/custom/widget/WorkflowTemplateSelectorDialog.vue`:
- Around line 549-552: The watcher on selectedNavItem in
WorkflowTemplateSelectorDialog.vue is firing telemetry for all changes to
selectedNavItem, including programmatic changes that occur when the sort order
changes (line 622 resets selectedNavItem from popular to all). Move the
trackTemplateCategorySelected telemetry call from the selectedNavItem watcher to
the actual user interaction handler (the click/select event that triggers the
category selection) instead, so telemetry only fires for intentional user
selections and not for programmatic resets triggered by sort changes.

In `@src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.ts`:
- Around line 132-140: The PostHog SDK initialization configuration in
PostHogTelemetryProvider contains an invalid configuration key `heatmaps: true`
which is not supported by PostHog SDK v1.358.1. Replace the `heatmaps` key with
`enable_heatmaps` in the configuration object that includes other properties
like `autocapture`, `capture_pageview`, `capture_pageleave`, and `persistence`
to properly enable heatmaps functionality in PostHog.

---

Outside diff comments:
In `@src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts`:
- Around line 101-114: In the test for PostHog initialization (the it block that
calls posthog.init with token and default config), update the three boolean
properties in the expect.objectContaining call: change autocapture from false to
true, capture_pageview from false to true, and capture_pageleave from false to
true to match the new default values set by the provider.

In `@src/stores/authStore.ts`:
- Around line 340-365: The customer creation block within the action function
(lines 344-350) shares the same try-catch error handler as the auth action call,
causing createCustomer failures to incorrectly trigger trackAuthError telemetry
even when authentication succeeds. To fix this, restructure the code by moving
the customer creation logic into a separate try-catch block that is executed
after the auth action succeeds and outside the catch block that handles
authError tracking. This ensures trackAuthError only fires for actual
authentication failures from the action call, not for downstream provisioning
failures in createCustomer.

---

Nitpick comments:
In `@src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts`:
- Around line 327-337: The test file PostHogTelemetryProvider.test.ts currently
has a test case for trackBillingCycleToggled but is missing test coverage for
the two other new telemetry methods: trackAuthError and
trackTemplateCategorySelected. Add two new test cases following the same pattern
as the existing trackBillingCycleToggled test - each should create a provider
instance, call the respective method with appropriate test parameters, and
assert that hoisted.mockCapture is called with the expected TelemetryEvents
constant and payload data.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0f954fac-5988-4331-96f7-95adeb4eaed1

📥 Commits

Reviewing files that changed from the base of the PR and between edf3e1a and ffd37e8.

📒 Files selected for processing (11)
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/platform/cloud/subscription/components/PricingTable.test.ts
  • src/platform/cloud/subscription/components/PricingTable.vue
  • src/platform/cloud/subscription/components/SubscribeButton.vue
  • src/platform/cloud/subscription/components/SubscribeToRun.test.ts
  • src/platform/cloud/subscription/components/SubscribeToRun.vue
  • src/platform/telemetry/TelemetryRegistry.ts
  • src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.test.ts
  • src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.ts
  • src/platform/telemetry/types.ts
  • src/stores/authStore.ts

Comment on lines +549 to +552
watch(selectedNavItem, (to, from) => {
if (!to || to === from) return
useTelemetry()?.trackTemplateCategorySelected({ category_id: to })
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Category-selection telemetry fires on internal sort-driven nav resets.

Line 549 watches all selectedNavItem changes, but Line 622 also sets selectedNavItem programmatically (popularall) when sort changes. That means trackTemplateCategorySelected is emitted for non-user category selections.

Proposed fix
 const selectedNavItem = ref<string | null>(initialCategory)
+const navChangeSource = ref<'user' | 'sort_sync'>('user')

 watch(selectedNavItem, (to, from) => {
+  if (navChangeSource.value === 'sort_sync') {
+    navChangeSource.value = 'user'
+    return
+  }
   if (!to || to === from) return
   useTelemetry()?.trackTemplateCategorySelected({ category_id: to })
 })
@@
   } else if (source === 'sort') {
@@
     if (isPopularNav && !isPopularSort) {
+      navChangeSource.value = 'sort_sync'
       selectedNavItem.value = 'all'
     }
   }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/custom/widget/WorkflowTemplateSelectorDialog.vue` around lines
549 - 552, The watcher on selectedNavItem in WorkflowTemplateSelectorDialog.vue
is firing telemetry for all changes to selectedNavItem, including programmatic
changes that occur when the sort order changes (line 622 resets selectedNavItem
from popular to all). Move the trackTemplateCategorySelected telemetry call from
the selectedNavItem watcher to the actual user interaction handler (the
click/select event that triggers the category selection) instead, so telemetry
only fires for intentional user selections and not for programmatic resets
triggered by sort changes.

Comment on lines +132 to 140
// Web analytics enabled so cloud.comfy.org gets heatmaps + $pageview
// (the login/onboarding pages previously had zero coverage). autocapture
// does NOT record input *values* (posthog masks them), and these defaults
// remain overridable per-environment via `serverConfig` (spread below).
autocapture: true,
capture_pageview: true,
capture_pageleave: true,
heatmaps: true,
persistence: 'localStorage+cookie',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

For the posthog-js version used in this repository, what is the correct posthog.initoption to enable heatmaps? Isheatmapsvalid, or should a different key be used (for exampledisable_heatmaps)?

💡 Result:

To enable heatmaps in posthog-js, the correct configuration option to use in the posthog.init call is enable_heatmaps [1][2]. You should set this option to true within the configuration object: posthog.init('<ph_project_token>', { api_host: 'https://us.i.posthog.com', enable_heatmaps: true }) While some internal configuration references or older/alternative settings may show capture_heatmaps [3], the official and documented key for enabling this feature via initialization is enable_heatmaps [1][2]. Note that if you want to disable features, PostHog typically uses a disable_* prefix (e.g., disable_session_recording), but for enabling heatmaps, the enable_heatmaps key is the standard approach [1][3].

Citations:


🏁 Script executed:

# Check the PostHogTelemetryProvider.ts file around line 139
sed -n '130,145p' src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.ts

# Also check the PostHog version in package.json
rg '"posthog"' package.json -A 1

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1058


🏁 Script executed:

# Check PostHog version
rg '"posthog"' package.json -B 1 -A 1

# Also verify the TypeScript error by checking tsconfig
fd -n tsconfig

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 301


🏁 Script executed:

# Check PostHog version
rg '"posthog"' package.json -B 1 -A 1

# Find tsconfig files
fd tsconfig

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 502


🏁 Script executed:

# Find package.json files and check PostHog version
find . -name "package.json" -type f | head -5 | xargs grep -l "posthog"

# Check the root package.json for PostHog
cat package.json | grep -A 2 -B 2 "posthog"

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 252


🏁 Script executed:

# Check pnpm workspace catalog or pnpm-lock.yaml for actual PostHog version
rg 'posthog-js' pnpm-lock.yaml -A 3 | head -20

# Also check the catalog in package.json structure
cat package.json | grep -A 50 "catalog"

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 5781


🏁 Script executed:

# Check if there are any TypeScript definitions for PostHog to see what keys are allowed
rg "interface PostHogConfig" --type ts -A 20

# Also search for any existing usage of enable_heatmaps or heatmaps in the codebase
rg "enable_heatmaps|heatmaps" --type ts -B 2 -A 2

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1356


🏁 Script executed:

# Check the node_modules PostHog types to see if heatmaps is a valid config key
rg "heatmaps|enable_heatmaps" node_modules/posthog-js -t ts -A 1 -B 1 2>/dev/null | head -30

# Also check what keys are actually defined in PostHogConfig
rg "PostHogConfig" node_modules/posthog-js --type ts -A 30 2>/dev/null | head -50

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 52


🏁 Script executed:

# Check if there's a build or tsc output showing the error
rg "TS2353" . --type ts --type json 2>/dev/null | head -10

# Let's verify the exact line and surrounding context
sed -n '128,145p' src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.ts | cat -n

Repository: Comfy-Org/ComfyUI_frontend

Length of output: 1249


Replace heatmaps with enable_heatmaps on line 139

The PostHog SDK (v1.358.1) does not support the heatmaps configuration key. Use enable_heatmaps: true instead to enable heatmaps in the initialization config.

🧰 Tools
🪛 GitHub Actions: CI: Dist Telemetry Scan / 0_scan.txt

[error] 139-139: TypeScript (vue-tsc) error TS2353: Object literal may only specify known properties; 'heatmaps' does not exist in type 'Partial'.

🪛 GitHub Actions: CI: Dist Telemetry Scan / scan

[error] 139-139: TypeScript (vue-tsc) error TS2353: Object literal may only specify known properties, and 'heatmaps' does not exist in type 'Partial'.

🪛 GitHub Actions: CI: OSS Assets Validation / 1_validate-fonts.txt

[error] 139-139: TypeScript (vue-tsc) failed with TS2353: Object literal may only specify known properties; property 'heatmaps' does not exist in type 'Partial'.

🪛 GitHub Actions: CI: OSS Assets Validation / validate-fonts

[error] 139-139: TypeScript (vue-tsc) error TS2353: Object literal may only specify known properties, and 'heatmaps' does not exist in type 'Partial'.

🪛 GitHub Check: scan

[failure] 139-139:
Object literal may only specify known properties, and 'heatmaps' does not exist in type 'Partial'.

🪛 GitHub Check: validate-fonts

[failure] 139-139:
Object literal may only specify known properties, and 'heatmaps' does not exist in type 'Partial'.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/platform/telemetry/providers/cloud/PostHogTelemetryProvider.ts` around
lines 132 - 140, The PostHog SDK initialization configuration in
PostHogTelemetryProvider contains an invalid configuration key `heatmaps: true`
which is not supported by PostHog SDK v1.358.1. Replace the `heatmaps` key with
`enable_heatmaps` in the configuration object that includes other properties
like `autocapture`, `capture_pageview`, `capture_pageleave`, and `persistence`
to properly enable heatmaps functionality in PostHog.

Sources: Linters/SAST tools, Pipeline failures

@deepme987

Copy link
Copy Markdown
Contributor Author

Folded into #12894 (the consolidated cloud telemetry PR): merged this branch in, unioning the new events (auth_error, billing_cycle_toggled, template_category_selected, subscribe-click coverage) with #12894's funnel events. Note: heatmaps: true was dropped from the PostHog init — it's a RemoteConfig field in posthog-js 1.358, not a client init option, so it wouldn't typecheck on current main; heatmaps are toggled via PostHog project settings. Closing in favor of one frontend telemetry PR.

@deepme987 deepme987 closed this Jun 18, 2026
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.

1 participant