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
19.63k stars 1.15k forks source link

Feature flags based on events (or behavioral cohorts) #14796

Open lharries opened 1 year ago

lharries commented 1 year ago

Is your feature request related to a problem?

Quite a few people internally are wanting to use behavior cohorts for feature flags to target the user interviews - e.g. me, Annika, Ian, Neil all ran into this. The current workflow is to export the dynamic list to a CSV then reupload as a static cohort. However, I don't think would be obvious to non-posthog team members.

The other use case which came up recently from a customer was for managing prompts - they wanted to target the prompts based on users completing certain events.

(It's worth noting that these two use cases are more JSON focused and quite different to a traditional feature flag engineering workflow, so might not be a core focus however)

You also have clients doing hacky workarounds to try and get it working: https://github.com/PostHog/posthog/issues/11070

Describe the solution you'd like

Ideally be able to target feature flags based on events or behavioral cohorts but I understand that this would be quite a bit of work.

I wonder if a good short-term solution would be making the above workflow much easier? Instead of the current error message saying we don't support behavioral cohorts, we could offer a one-off snapshot of the current behavioral cohort as a static cohort and use that? (How it actually works and the UX up to the team) In future, when we have temporal we could then increase the refresh rate from one-off to once a week / once a day etc.

Describe alternatives you've considered

Improve the error message to suggest exporting as a csv and then re-uploading as a static cohort.

Thank you for your feature request – we love each and every one!

lharries commented 1 year ago

From the convo with Ian who used JSON feature flags for a user interview:

Screenshot Search Results - PostHog - 11 new items - Slack (Slack) 2023-03-16 at 22 13@2x
lharries commented 1 year ago

Previous conversation we've had on this: Screenshot Search Results - PostHog - 11 new items - Slack (Slack) 2023-03-16 at 22 16@2x

neilkakkar commented 1 year ago

I heard chatter on the vine about @mariusandra calling something 'Computed properties' and I'm not sure if that's the same computed properties as the computed properties I'm suggesting here 👀

neilkakkar commented 1 year ago

Also, agree regarding workflow for converting dynamic cohort to static. Should ideally all happen in-app, one click.

slshults commented 3 months ago

+1 https://posthoghelp.zendesk.com/agent/tickets/12142