- Optimizely Web Experimentation
- Optimizely Performance Edge
Force parameters are disabled by default in Optimizely to help protect the privacy of your account.
Optimizely Performance Edge and Optimizely Web Experimentation handle force parameters the same way, so all information contained in this article applies to experiments created with either version.
To use force parameters, follow these steps:
- Go to Settings > Implementation.
If you have custom snippets, you will have to edit the custom snippet by clicking the name then scrolling down to Privacy.
- Deselect Disable the force variation parameter. See more information about that setting.
- If you want to force variations for draft or paused experiments to appear, select Allow anyone to view draft or paused experiments. Remember, this setting lets anyone view your draft or paused changes simply by adding
- Append the query parameter to your site's URL.
- after you are done, return your settings to the default mode. Go to Settings > Implementation Settings to select Disable the force variation parameter.
Optimizely Web Experimentation and Optimizely Performance Edge let you use URL parameters to force a specific variation or personalized experience to appear. The parameters let you skip all targeting conditions (like audiences) and force the variation code to execute on the page. Force parameters are best used to check changes that are not too technically complex or dependent on timing.
For example, if you change the text or an image on your homepage, you can append a query parameter to view the change without worrying about having to meet the targeting conditions.
Force variation parameters are also a great way to share variations with key stakeholders. They help you:
- Test variations outside of the editor
- Disable Optimizely Web Experimentation and Optimizely Performance Edge code on a page
- View draft or paused experiments (with the help of a public token)
Essentially, you add a query parameter to the end of a URL on your site that tells Optimizely Web Experimentation and Optimizely Performance Edge which variation or experience to run when the page loads. You can also force yourself into an audience with the
optimizely_x_audiences=audienceId query parameter. For a list of query parameters you can use, see below.
- Forcing a variation to run will disable all other variations and experiments that are running on the page.
- Forcing a variation or audience will not force an experiment or Page to activate. You will still need to meet the URL Targeting and Activation conditions.
The basic syntax for force parameters in Optimizely Web Experimentation and Optimizely Performance Edge.
- Force a variation or personalized experience from a running, published experiment to display.
For example, to see a Variation with the ID 1234567890 in an experiment:
You can force multiple variations across experiments by comma-separating different variation IDs. For example, to see a Variation with the ID 1234567890 from experiment 1, and a Variation with the ID 9876543210 from experiment 2:
With Performance Edge, you can use force parameters only on published and running experiments.
- Enable tracking while using the force parameter
- Force a variation or personalized experience from a draft or paused experiment to display.
For example, to see variation with ID 1234567890 of a draft experiment:
To use this parameter, you need to enable certain Privacy Settings.
- Force yourself into a specific audience.
For example, if your Audience ID is 1123581220 and you want to view an experiment or campaign as that audience:
You can use a comma-separated list of Audience IDs, such as:
optimizely_x_audiences=1123581220,987654321,510203040(for audiences with these IDs: 1123581220, 987654321, 510203040).
- Disable Optimizely Web Experimentation and Optimizely Performance Edge from running on the page.
Query parameters in a running experiment
When you use query parameters in a running experiment, the variation you force will display and your variation mapping are updated in
If you were previously bucketed in a different variation, the force parameter updates that bucketing. You then are persistently bucketed into the new variation.
Force variations for paused or draft mode experiments or campaigns
You can use a public token to force variations for draft or paused experiments if you are willing to let anyone view draft or paused experiments. You need to enable this parameter in your project's privacy settings.
optimizely_token=PUBLICto the Preview URL. Disable this setting after you finished testing.
Alternatively, use the Share Link feature to show draft variations and experiences that haven't been published to team members without exposing these variations or experiences broadly.
If your site has the URL
http://atticandbutton.us/. If you run an experiment with the ID 123456 and you want to force yourself into variation with ID 1234567890:
If you pause your experiment, and you want to view variation with ID 2345678901 of the paused experiment, enable the public token, then view the variation with this URL and query parameter:
Manual and conditional activation
If you use manual or conditional activation:
- Manual activation – the parameter activates a running experiment only
- Conditional activation – the parameter activates the experiment only if the activation conditions are met (that is, the conditional activation code evaluates to true)