Skip to main content

Adding Rules

Create a rule for a feature flag

note

Usually referred to online as feature flags, the Statsig UI and SDKs call them feature gates.

By default, a feature gate check returns false when there are no rules configured to target a set of users. You can add a rule to a feature gate to expose the new feature to a targeted set of users as follows:

  • Log into the Statsig console at https://console.statsig.com
  • On the left-hand navigation panel, select Feature Gates
  • Select the feature gate where you want to add a targeting rule
  • Click the Add New Rule button

image

  • You can select the criteria for identifying your target users in several ways:

    • You can target users based on common application properties such as the operating system that the application is running on as shown below

      image

    • You can target users based on their attributes; for example, you can select the user's Email attribute and the Contains any of operator, and enter the email domain of your company to target only internal employees as shown below

      image

    • You can target users in a defined segment as shown below

      image

    • You can target users who are eligible for another feature gate as shown below; this ensures that this feature gate is activated only for users who pass (or fail) the selected target gate check

      image

  • Click the Add Rule button

  • You can optionally edit a percentage share of eligible users who see the new feature (treatment/pass) vs. the default (control/fail) behavior by clicking on the edit icon for the rule

image

  • Click the Save Changes button at the top right corner of the Rules section