View Source GrowthBook.Experiment (GrowthBook v0.3.0)
Struct holding Experiment configuration.
Holds configuration data for an experiment.
Link to this section Summary
Functions
Creates new experiment struct from rule.
Link to this section Types
Specs
t() :: %GrowthBook.Experiment{ active?: boolean() | nil, 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: integer() | nil, hash_attribute: String.t() | nil, hash_version: integer() | nil, key: String.t(), meta: [GrowthBook.VariationMeta.t()], min_bucket_version: integer() | nil, name: String.t() | nil, namespace: GrowthBook.namespace() | nil, parent_conditions: [GrowthBook.ParentCondition.t()] | nil, phase: String.t() | nil, ranges: [GrowthBook.BucketRange.t()], seed: String.t() | nil, variations: [variation()], weights: [float()] }
Experiment
Defines a single Experiment. Has a number of properties:
key
(String.t/0
) - The globally unique identifier for the experimentvariations
(list ofvariation/0
) - The different variations to choose betweenweights
(list offloat/0
) - How to weight traffic between variations. Must add to 1.active?
(boolean/0
) - If set to false, always return the control (first variation)coverage
(float/0
) - What percent of users should be included in the experiment (between 0 and 1, inclusive)ranges
(list ofGrowthBook.BucketRange.t/0
) - Array of ranges, one per variationcondition
(GrowthBook.Condition.t/0
) - Optional targeting conditionnamespace
(GrowthBook.namespace/0
) - Adds the experiment to a namespaceforce
(integer/0
) - All users included in the experiment will be forced into the specific variation indexhash_attribute
(String.t/0
) - What user attribute should be used to assign variations (defaults to id)fallback_attribute
(String.t/0
) - When using sticky bucketing, can be used as a fallback to assign variationshash_version
(integer/0
) - The hash version to use (default to 1)meta
(list ofGrowthBook.VariationMeta.t/0
) - Meta info about the variationsfilters
(list ofGrowthBook.Filter.t/0
) - Array of filters to applyseed
(String.t/0
) - The hash seed to usename
(String.t/0
) - Human-readable name for the experimentphase
(String.t/0
) - Id of the current experiment phasedisable_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 experimentparent_conditions
(list ofGrowthBook.ParentCondition.t/0
) - Optional parent conditions
Specs
Variation
Defines a single variation. It may be a map, a number of a string.
Link to this section Functions
Specs
from_rule(String.t(), GrowthBook.FeatureRule.t()) :: t()
Creates new experiment struct from rule.