View Source GrowthBook.ExperimentResult (GrowthBook v0.3.0)

Struct holding the results of an GrowthBook.Experiment.

Holds the result of running an GrowthBook.Experiment against a GrowthBook.Context.

Link to this section Summary

Types

t()

Experiment result

Link to this section Types

Specs

t() :: %GrowthBook.ExperimentResult{
  bucket: float(),
  feature_id: String.t(),
  hash_attribute: String.t(),
  hash_used?: boolean(),
  hash_value: String.t() | integer(),
  in_experiment?: boolean(),
  key: String.t(),
  name: String.t(),
  passthrough?: boolean(),
  sticky_bucket_used?: boolean(),
  value: term(),
  variation_id: integer()
}

Experiment result

The result of running an GrowthBook.Experiment given a specific GrowthBook.Context

  • in_experiment? (boolean/0) - Whether or not the user is part of the experiment
  • variation_id (integer/0) - The array index of the assigned variation
  • value (any/0) - The array value of the assigned variation
  • hash_used? (boolean/0) - If a hash was used to assign a variation
  • hash_attribute (String.t/0) - The user attribute used to assign a variation
  • hash_value (String.t/0) - The value of that attribute
  • feature_id (String.t/0) - The id of the feature (if any) that the experiment came from
  • key (String.t/0) - The unique key for the assigned variation
  • bucket (float/0) - The hash value used to assign a variation (float from 0 to 1)
  • name (String.t/0) - The human-readable name of the assigned variation
  • passthrough? (boolean/0) - Used for holdout groups
  • sticky_bucket_used? (boolean/0) - If sticky bucketing was used to assign a variation

The variation_id and value should always be set, even when in_experiment? is false.

The hash_attribute and hash_value should always be set, even when hash_used? is false.

The key should always be set, even if experiment.meta is not defined or incomplete. In that case, convert the variation's array index to a string (e.g. 0 -> "0") and use that as the key instead.