HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Describe experiments running on the page, indexed by experiment ID.

window.optimizelyEdge.get('state').getActiveExperiments()
> {'123': {id: '123', name: 'Landing Page Experiment', variation: {id: '456', name: 'New CTA Text'}}

Parameters

None

Returns

An object mapping experiment ID (key) to experiment object (see below)

Parameter

Type

Description

experiment

object

Description of the experiment

experiment.id

string

ID of the experiment

experiment.name

string | null

Descriptive name of the experiment, set in Optimizely. If the "Mask Descriptive Names" feature is enabled, this is null.

experiment.variation

object

Description of the selected variation

experiment.variation.id

string

ID of the selected variation

experiment.variation.name

string | null

Descriptive name of the variation, set in Optimizely. If the "Mask Descriptive Names" feature is enabled, this is null.