From 32129b346e897d83261bb4455cdaded5c971dd2d Mon Sep 17 00:00:00 2001 From: Adam Bowker Date: Mon, 20 Jul 2026 15:00:55 -0400 Subject: [PATCH] fix(analytics): disable posthog-js survey rendering in the app The shared analytics project runs many popover surveys targeted at the PostHog web app; any launched survey without URL/event conditions could render inside PostHog Code. The app's own survey UI submits responses via captureSurveyResponse, which is unaffected. Generated-By: PostHog Code Task-Id: 46939c2b-b77a-4c50-b13b-4d464103e6ac --- packages/ui/src/shell/posthogAnalyticsImpl.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/ui/src/shell/posthogAnalyticsImpl.ts b/packages/ui/src/shell/posthogAnalyticsImpl.ts index bf8c8478b8..e402a36449 100644 --- a/packages/ui/src/shell/posthogAnalyticsImpl.ts +++ b/packages/ui/src/shell/posthogAnalyticsImpl.ts @@ -79,6 +79,12 @@ export function initializePostHog(sessionId?: string) { session_recording: { captureCanvas: { recordCanvas: false }, }, + // The shared analytics project runs many popover surveys aimed at the + // PostHog web app; any one without URL/event conditions would render here + // too. This app only submits survey responses through its own UI + // (captureSurveyResponse), which posthog-js survey rendering being off + // does not affect. + disable_surveys: true, session_idle_timeout_seconds: SESSION_IDLE_TIMEOUT_SECONDS, ...(sessionId ? { bootstrap: { sessionID: sessionId } } : {}), capture_exceptions: import.meta.env.DEV