Skip to content

fix(analytics): disable posthog-js survey rendering in the app#3600

Open
adboio wants to merge 1 commit into
mainfrom
posthog-code/disable-posthog-js-surveys
Open

fix(analytics): disable posthog-js survey rendering in the app#3600
adboio wants to merge 1 commit into
mainfrom
posthog-code/disable-posthog-js-surveys

Conversation

@adboio

@adboio adboio commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

  • Add disable_surveys: true to the shared posthog.init config in packages/ui/src/shell/posthogAnalyticsImpl.ts.

Deliberate in-app surveys are unaffected: the canvas FeedbackModal submits responses manually via captureSurveyResponse (survey sent capture), which does not depend on posthog-js survey rendering.

How did you test this?

  • pnpm exec turbo typecheck --filter=@posthog/ui (passes)
  • biome check on the changed file (clean)

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

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
@trunk-io

trunk-io Bot commented Jul 20, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 32129b3.

@adboio
adboio marked this pull request as ready for review July 20, 2026 21:04
@adboio adboio added the Stamphog This will request an autostamp by stamphog on small changes label Jul 20, 2026
@adboio
adboio requested a review from a team July 20, 2026 21:04

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Simple config flag addition to disable posthog-js survey popups; no logic, data model, or API contract changes.

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(analytics): disable posthog-js surve..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant