PostHog / PostHog/posthog

Feature Request: average time between two events

Open
#58,818 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement experiments/new-engine team/experiments
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?

When running experiments, there's no native way to use "average time between two events" as a metric. Users who want to measure things like time-to-complete a task, time between activation steps, or time from first action to conversion have to resort to workarounds. This makes it hard to use time-based metrics as experiment success criteria without extra instrumentation.

Describe the solution you'd like

A new experiment metric type (or an extension of the existing Mean metric) that allows users to select two events – a start event and an end event – and automatically computes the average time elapsed between them per user, then compares that mean across variants statistically.

This would mirror the "average time to convert" already shown in funnel insights, but exposed as a proper experiment metric with statistical significance testing.

Describe alternatives you've considered

Custom property on end event: Calculate the time delta client-side and send it as a property (e.g. time_to_complete_ms), then use a Mean metric on that property. This works but requires extra instrumentation and isn't available for users who don't control the event schema.
Funnel metric: Funnels show average/median conversion time between steps, but this isn't surfaced as a comparable numeric metric in experiments.
tickets/58377

Debug info

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 file or test is named. Start with ticket 58377 and the existing funnel-insights conversion-time behavior described here, then locate the experiment metric and Mean metric entry points. Done means the two-event elapsed-time metric is available for experiments and supports statistical comparison across variants.

Written by the indexing model from the issue text.

Assessment

Domain
analytics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.