Skip to content

Conversation

@adboio
Copy link
Contributor

@adboio adboio commented Nov 18, 2025

Problem

adding "opportunity detection" logic & button to support survey x insights cross sell.

user sees "Ask users why ->" on an insight, which prompts posthog AI to create a survey to help them improve conversion

Changes

new opportunity logic detects the "best" insight on a given dashboard to propose a survey, by this logic:

  1. get all insights on a dashboard
  2. filter only funnel insights
  3. calculate overall conversion rate, filter only funnels with < 50%
  4. return funnel with lowest conversion rate

SurveyOpportunityButton opens posthog AI, prompting to create a survey to understand/fix low conversion

How did you test this code?

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Changelog: (features only) Is this feature complete?

Copy link
Contributor Author

adboio commented Nov 18, 2025

@wiz-7ad640923b
Copy link

wiz-7ad640923b bot commented Nov 18, 2025

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

Size Change: +38 B (0%)

Total Size: 3.41 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 3.41 MB +38 B (0%)

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2025

🔍 Migration Risk Analysis

We've analyzed your migrations for potential risks.

Summary: 0 Safe | 0 Needs Review | 1 Blocked

❌ Blocked

Causes locks or breaks compatibility

posthog.0905_survey_add_linked_insight
  │  └─ #1 ✅ SeparateDatabaseAndState
  │     Wrapper operation - see nested operations for risk: RunSQL, RunSQL
  │     database_operations: RunSQL, RunSQL
  │     └─ #2 ⚠️ RunSQL: RunSQL with ALTER may cause locks
  │     └─ #3 ⚠️ RunSQL: CREATE INDEX CONCURRENTLY is safe (non-blocking)
  │
  └──> ⚠️  COMBINATION RISKS:
       ❌ BLOCKED: #2 RunSQL mixed with other operations    RunSQL with
       DDL (CREATE INDEX/ALTER TABLE) should be isolated in their own
       migration to avoid lock conflicts.
       ⚠️  INFO: Migration is marked atomic=False. Ensure data
       migrations handle failures correctly.

Last updated: 2025-11-18 17:57 UTC (80bde47)

@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from ce2de5b to 5a7d485 Compare November 18, 2025 17:07
@adboio adboio force-pushed the 11-18-feat_surveys_add_linked_insight_id_field branch from b56cccc to e223d81 Compare November 18, 2025 17:07
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from a671dad to 540f6df Compare November 18, 2025 17:37
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from 540f6df to 80bde47 Compare November 18, 2025 17:50
@adboio adboio force-pushed the 11-18-feat_surveys_add_linked_insight_id_field branch 2 times, most recently from 8376cd2 to 873f786 Compare November 18, 2025 18:44
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from 80bde47 to 143ed62 Compare November 18, 2025 18:44
@adboio adboio changed the base branch from 11-18-feat_surveys_add_linked_insight_id_field to graphite-base/41694 November 18, 2025 19:02
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from 143ed62 to 2c723ca Compare November 18, 2025 19:02
@adboio adboio changed the base branch from graphite-base/41694 to 11-18-feat_surveys_add_index November 18, 2025 19:02
@adboio adboio force-pushed the 11-18-feat_surveys_add_index branch from 11526f8 to 1fb0030 Compare November 18, 2025 19:08
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from 2c723ca to c385634 Compare November 18, 2025 19:08
@adboio adboio force-pushed the 11-18-feat_surveys_add_index branch from 1fb0030 to a475441 Compare November 18, 2025 19:37
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from c385634 to 2da0d87 Compare November 18, 2025 19:37
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from 2da0d87 to d6e817f Compare November 18, 2025 20:00
@adboio adboio force-pushed the 11-18-feat_surveys_add_index branch 2 times, most recently from bc9b976 to 32394e7 Compare November 18, 2025 20:12
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from d6e817f to 8370309 Compare November 18, 2025 20:12
@adboio adboio force-pushed the 11-18-feat_surveys_create_survey_cross-sell_opportunity_logic branch from 8370309 to da5dc57 Compare November 18, 2025 20:16
@adboio adboio force-pushed the 11-18-feat_surveys_add_index branch from 32394e7 to 7ead735 Compare November 18, 2025 20:16
@adboio adboio changed the base branch from 11-18-feat_surveys_add_index to graphite-base/41694 November 20, 2025 04:58
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.

2 participants