Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lharries opened this issue Mar 16, 2023 · 11 comments
Open

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

lharries opened this issue Mar 16, 2023 · 11 comments
Assignees

Comments

@lharries
Copy link
Contributor

lharries commented Mar 16, 2023

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: #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 lharries added enhancement New feature or request feature/feature-flags Feature Tag: Feature flags labels Mar 16, 2023
@lharries
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@neilkakkar
Copy link
Contributor

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
Copy link
Contributor

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

@neilkakkar neilkakkar added the feature/cohorts Feature Tag: Cohorts label Mar 17, 2023
@slshults
Copy link
Contributor

slshults commented Apr 1, 2024

@WonderPanda
Copy link

WonderPanda commented Aug 21, 2024

As a step in the right direction, it would be really nice if there was a way to configure a static cohort to periodically update from its dynamic cohort automatically. For a fair number of cases, I imagine eventual consistency would be fine for the feature flag being turned on once a user enters a dynamic cohort

As a workaround I'm considering using the private API to periodically poll the users in a cohort and then set user properties for all the results so that I can create a Feature Flags that target a specific user property. However, it would be really awesome if PostHog had some built in functionality for it

@roe
Copy link

roe commented Nov 11, 2024

hi - is there any known workaround/suggested alternative in absence of this support?

our use case is we want to have a feature flag enabled for new users who do a certain event X times in Y days. was confused when I made a cohort but it did not show up in the feature flag when I tried to target it.

after googling/help docs, found this thread, looks like this is not supported. right now we have a manual painful process of updating a static cohort to do this and if the dynamic ability existed, this would be solved for us

EDIT for anyone else finding this, ended up going w/ a workaround by dynamically adding properties via a separate script using the posthog api. Annoying as it has to be run separately and the dynamic cohort would solve this but at least works for now.

@marioandrearaujo
Copy link

Apparently this is what prevents us from running surveys based on dynamic cohorts. From a usefulness perspective, not being able to run a CSAT survey to an active user (with a dynamic definition) makes it pretty unusable for recurring use cases like this.

@darkopia
Copy link

@darkopia
Copy link

@lucasheriques
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests