fix(analytics): disable posthog-js survey rendering in the app#3600
Open
adboio wants to merge 1 commit into
Open
fix(analytics): disable posthog-js survey rendering in the app#3600adboio wants to merge 1 commit into
adboio wants to merge 1 commit into
Conversation
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
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
adboio
marked this pull request as ready for review
July 20, 2026 21:04
Contributor
|
Reviews (1): Last reviewed commit: "fix(analytics): disable posthog-js surve..." | Re-trigger Greptile |
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.
Problem
Popover surveys from the shared analytics project can render inside PostHog Code. The project runs a large number of launched surveys aimed at the PostHog web app, and any survey without URL or event conditions (gated only by flags/cohorts) passes eligibility inside this app too — one such survey has already been shown to users from within the app. Because the desktop app uses hash routing and its own event names, survey authors' targeting assumptions simply don't apply here, and nothing in the init config opted us out.
Why
Raised because surveys started appearing while running the desktop app in dev; the app never intended to show posthog-js popover surveys and loose targeting on the shared project makes accidental display an ongoing risk.
Changes
disable_surveys: trueto the sharedposthog.initconfig inpackages/ui/src/shell/posthogAnalyticsImpl.ts.Deliberate in-app surveys are unaffected: the canvas
FeedbackModalsubmits responses manually viacaptureSurveyResponse(survey sentcapture), which does not depend on posthog-js survey rendering.How did you test this?
pnpm exec turbo typecheck --filter=@posthog/ui(passes)biome checkon the changed file (clean)Automatic notifications
Created with PostHog Code