PostHog / PostHog/posthog

feat(experiments): anchor shared retention metrics on the experiment's exposure event

Open
#100,804 0 comments 0 reactions 1 assignee View on GitHub

@ella-c-ph is already working on this.

Since Sep 15, 2026.

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

Description

Feature request

Let a retention metric's start event resolve to the experiment's exposure event, per experiment, so one shared (saved) retention metric can be reused across experiments that use different exposure events. Today retention requires a literal start event that is fixed when the metric is saved, so a shared retention metric is stuck on that one event. Funnel metrics already resolve the exposure event per experiment (they prepend it as step 0) - retention should tap the same resolution, e.g. an "Exposure event" option in the start-event picker that resolves to the experiment's resolved exposure event.

Use case

A team runs many experiments, each with its own dedicated exposure event, and wants one reusable "did they return 24-48h after entering the experiment?" (D2 retention) metric to attach across all of them. With a fixed start event, a shared retention metric measures the wrong population on experiments whose exposure differs; hardcoding $feature_flag_called silently mismatches when the resolved exposure is $experiment_exposure or a custom event. Resolving the start to each experiment's own exposure event makes one shared retention metric correct everywhere - the same way shared funnel metrics already work.

Draft PR with a first pass (agent-assisted, a starting point, not a review request): https://github.com/PostHog/posthog/pull/97517

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.