View Source GrowthBook.FeatureRule (GrowthBook v0.3.0)

Struct holding Feature rule configuration.

Holds rule configuration to determine if a feature should be run, given the active GrowthBook.Context.

Link to this section Summary

Types

t()

Feature rule

Link to this section Types

Specs

t() :: %GrowthBook.FeatureRule{
  bucket_version: integer() | nil,
  condition: GrowthBook.Condition.t() | nil,
  coverage: float() | nil,
  disable_sticky_bucketing: boolean() | nil,
  fallback_attribute: String.t() | nil,
  filters: [GrowthBook.Filter.t()] | nil,
  force: term() | nil,
  hash_attribute: String.t() | nil,
  hash_version: integer() | nil,
  key: String.t() | nil,
  meta: [GrowthBook.VariationMeta.t()] | nil,
  min_bucket_version: integer() | nil,
  name: String.t() | nil,
  namespace: GrowthBook.namespace() | nil,
  parent_conditions: [GrowthBook.ParentCondition.t()] | nil,
  phase: String.t() | nil,
  range: GrowthBook.BucketRange.t() | nil,
  ranges: [GrowthBook.BucketRange.t()] | nil,
  seed: String.t() | nil,
  variations: [term()] | nil,
  weights: [float()] | nil
}

Feature rule

Overrides the default_value of a GrowthBook.Feature. Has a number of optional properties

  • condition (GrowthBook.Condition.t/0) - Optional targeting condition
  • parent_conditions (list of GrowthBook.ParentCondition.t/0) - Each item defines a prerequisite where a condition must evaluate against a parent feature's value (identified by id). If gate is true, then this is a blocking feature-level prerequisite; otherwise it applies to the current rule only.
  • coverage (float/0) - What percent of users should be included in the experiment (between 0 and 1, inclusive)
  • force (term/0) - Immediately force a specific value (ignore every other option besides condition and coverage)
  • variations (list of term/0) - Run an experiment (A/B test) and randomly choose between these variations
  • key (String.t/0) - The globally unique tracking key for the experiment (default to the feature key)
  • weights (list of float/0) - How to weight traffic between variations. Must add to 1.
  • namespace (GrowthBook.namespace/0) - Adds the experiment to a namespace
  • hash_attribute (String.t/0) - What user attribute should be used to assign variations (defaults to id)
  • hash_version (integer/0) - The hash version to use (default to 1)
  • range (GrowthBook.BucketRange.t/0) - A more precise version of coverage
  • ranges (list of GrowthBook.BucketRange.t/0) - Ranges for experiment variations
  • meta (list of GrowthBook.VariationMeta.t/0) - Meta info about the experiment variations
  • filters (list of GrowthBook.Filter.t/0) - Array of filters to apply to the rule
  • seed (String.t/0) - Seed to use for hashing
  • name (String.t/0) - Human-readable name for the experiment
  • phase (String.t/0) - The phase id of the experiment
  • fallback_attribute (String.t/0) - When using sticky bucketing, can be used as a fallback to assign variations
  • disable_sticky_bucketing (boolean/0) - If true, sticky bucketing will be disabled for this experiment. (Note: sticky bucketing is only available if a StickyBucketingService is provided in the Context)
  • bucket_version (integer/0) - An sticky bucket version number that can be used to force a re-bucketing of users (default to 0)
  • min_bucket_version (integer/0) - Any users with a sticky bucket version less than this will be excluded from the experiment