PostHog / PostHog/posthog

Survey event triggers should fire in real-time, not for users who previously sent the event

Open
#65,237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Feature request

Is your feature request related to a problem?

Survey event triggers don't behave as real-time triggers. When I set a survey to show "when the user sends streak_extended", it also shows to users who fired that event in a previous session, even if they haven't fired it in the current session at all. The survey appears as soon as they open the app, not at the moment the event actually fires.

Describe the solution you'd like

Event-based survey triggers should be strictly real-time. A survey with an event trigger should only appear at the exact moment that event fires in the current session. Users who have previously fired the event in past sessions should not see the survey unless they fire the event again.

In other words: the event trigger should mean "show this survey right now because this event just fired," not "show this survey to anyone who has ever fired this event."

Describe alternatives you've considered

  • Removing the event trigger and relying on manual posthog.renderSurvey() calls from the codebase, but this defeats the purpose of no-code survey targeting.
  • Using person property filters as a workaround, but these are evaluated at session start rather than in real-time, so they have the same problem.

Additional context

This makes event-triggered surveys unreliable for moment-of-action feedback (e.g. showing a CSAT right after a user extends their streak). The current behavior undermines the core use case for event triggers.

Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by locating the survey event-trigger evaluation path and its session/event handling, then verify that a survey appears only when the event fires in the current session and not merely when the user fired it previously.

Written by the indexing model from the issue text.

Assessment

Domain
analytics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.