Statsig provides the capability to target experiments based on user properties, which can include actions users take within an application. When a user performs an action, such as clicking a button, this information can be passed to Statsig as a user property. This property can then be used as a targeting criterion for experiments or feature gates.
To implement this, developers can utilize a 'custom field' as described in the Statsig documentation. This field can be set up to reflect user actions or attributes, enabling real-time targeting based on these criteria.
It is important to note that Statsig operates on the properties of the user that are passed to it, and while it does not store the state of a user, it can act upon the properties provided. For instance, if a 'page_url' property is passed, it can be used to target users who land on a specific page.
Similarly, if an action is taken by the user, such as a button click, this can be communicated to Statsig and used for targeting. For best practices, it is advisable to map different events as different custom fields to avoid overwriting and ensure precise targeting.
For more details on setting up custom fields for targeting, refer to the Statsig documentation on Custom Fields.