PostHog / posthog

🦔 PostHog provides open-source product analytics, session recording, feature flagging and A/B testing that you can self-host.
https://posthog.com
Other
21.62k stars 1.29k forks source link

Funnel conversion time not factoring in conversion window #5677

Closed kpthatsme closed 3 years ago

kpthatsme commented 3 years ago

Bug description

I have a funnel with a 1 minute conversion window specified.

The avg time to convert is showing as 38 minutes.

Expected behavior

This funnel should only show users that convert within a minute, so the avg should be somewhere between 0-60s

How to reproduce

  1. https://app.posthog.com/insights?insight=FUNNELS&properties=%5B%5D&filter_test_accounts=true&events=%5B%7B%22id%22%3A%22signup%3A%20email%20modal%20shown%22%2C%22name%22%3A%22signup%3A%20email%20modal%20shown%22%2C%22type%22%3A%22events%22%2C%22order%22%3A0%7D%2C%7B%22id%22%3A%22%24pageleave%22%2C%22name%22%3A%22%24pageleave%22%2C%22type%22%3A%22events%22%2C%22order%22%3A1%7D%5D&actions=%5B%5D&funnel_viz_type=steps&display=FunnelViz&interval=day&new_entity=%5B%5D&funnel_window_interval_unit=minute&funnel_window_interval=1
  2. Set the conversion window to 1 minutes and load the chart (looks like conversion windows aren't saved in the URL)

Environment

Additional context

Thank you for your bug report – we love squashing them!

neilkakkar commented 3 years ago

An issue with how we calculate conversion times, noted! Working on a fix.

neilkakkar commented 3 years ago

Seems like there's more to the issue! Investigating.

Time to Convert view should clip at the conversion window as well with the above PR, but doesn't seem to be happening 👀

image

neilkakkar commented 3 years ago

Hmm, running the same query on Metabase returns the correct results. But not in the API? 🤔 - will wait a bit to confirm it's not a caching / bounce on cloud not happening properly issue.

neilkakkar commented 3 years ago

Working as expected!

Now look at these pretty time to convert graphs xD

image

neilkakkar commented 3 years ago

I think this plays a big role in resolving https://github.com/PostHog/posthog/issues/5439 - another way out of the binning problem is to limit the conversion window

kpthatsme commented 3 years ago

Awesome thank you for fixing @neilkakkar – this data is incredibly valuable

neilkakkar commented 3 years ago

Cheers! The priority here at least was clear cut ;)