Optimizely will be sunsetting Full Stack Experimentation on July 29, 2024. See the recommended Feature Experimentation migration timeline and documentation.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Remove Forced Variation

This topic describes how to remove the forced variation.

Clears the forced variation set by Set Variation, so that the normal bucketing flow can occur.


SDK v1.0.0 and higher


Forced bucketing variations take precedence over whitelisted variations, variations saved in a User Profile Service (if one exists), and the normal bucketed variation. Variations are overwritten when Set Forced Variation is invoked.


This table lists the required parameters for the Go SDK.

All keys inside object are also required
ExperimentOverrideKeyExperimentOverrideKey contains,
- ExperimentKey (string): The key of the experiment to set with the forced variation.
- UserID (string): The ID of the user to force into the variation.


Creating a client with Forced Variations:

overrideStore := decision.NewMapExperimentOverridesStore()
client, err := optimizelyFactory.Client(

Removing a forced variation using Remove Forced Variation:

overrideKey := decision.ExperimentOverrideKey{ExperimentKey: "test_experiment", UserID: "test_user"}

See also

Set Variation
Get Variation

Source files

The language/platform source files containing the implementation for Go is client.go.