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

Remove Forced Variation

This topic describes the remove forced variation method which removes any forced variations set by set variation so that a normal bucketing flow can occur.

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

Version

SDK v1.0.0 and higher

Description

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.

Parameters

This table lists the required parameters for the GO SDK.

ParameterTypeDescription
overrideKey
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.

Example

Creating a client with Forced Variations:

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

Removing a forced variation using Remove Forced Variation:

overrideKey := decision.ExperimentOverrideKey{ExperimentKey: "test_experiment", UserID: "test_user"}
overrideStore.RemoveVariation(overrideKey)

See also

Source files

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