Open neilkakkar opened 1 year ago
We'll want to support a person property as well, to make feature flag targeting easier. For example, if I had a property checking whether a person has interacted with a feature or not, I could then use this to target feedback modals specifically to these people.
We want users to be able to gather insights on feature-flagged features easily, while also making implementation easier.
We're testing whether people like a component that does it all for you, and also whether this kind of instrumentation leads to richer analytics.
There's three components to this feature:
posthog-js
helper functions that implement part of this interface.Essentially, the autocapture happens only inside the react component. However, the
posthog-js
functions should allow anyone, using any frontend framework, to build their own component.The interface supports 2 things:
$feature_visible
with property:{$feature_flag: <key>}
$feature_interaction
with property:{$feature_flag: <key>}
with corresponding posthog-js functions:
posthog.captureFeatureVisible(<key>)
andposthog.captureFeatureInteraction(<key>)
The React component, in addition to the above interface, also supports flag matching, so it can do the above things, and also control when to do them (when the flag is enabled).
Open questions:
$feature_interaction
property? Do we want to do what autocapture does, or keep it simple?$feature_visible
and$feature_interaction
?posthog-js
helpers at all, if the interface is so simple? It's just a capture call.