This article is about Optimizely Classic. If you're using Optimizely X, check this out instead.
relevant products:
  • Optimizely Classic

This article will help you:
  • Use a query parameter, aka the "force parameter," to preview a specific variation of an experiment in Optimizely Classic
  • Use additional query parameters to:
    • enable tracking when using the force parameter (which disables tracking by default)
    • create a JavaScript log in the browser console
    • disable Optimizely from running on a page

Before you run your experiment, you'll want to make sure that the variations you've built in the Editor perform as expected. Query parameters allow you to QA and see how your variations perform outside of the Editor, without running the experiment. 

Optimizely Classic has query parameters that allow you to view a specific variation, check the tracking on events in a variation, create a JavaScript log, and disable all Optimizely code on the page completely.

In Optimizely X, query parameters work only for live experiments. If you'd like to use them, check out this article. To preview both live and draft experiments, we recommend the Override tab in the new Preview tool.

Query Parameters at a Glance

These URL parameters will work on your own page (if the Optimizely snippet is present) and the hosted preview (when the Optimizely snippet has not been placed on the page). The basic syntax for each is listed here, and you can find more information about each parameter below.

To force yourself to see specific variations of an A/B test:


So, for example: show variation 1 of experiment 10730927.

To force yourself to see specific variations of an MVT (Multivariate test):


So, for example:

This will show variation 1 of section 1, the control of section 2, and variation 2 of section 3.

To enable tracking when using the force parameter:


So, for example:

To create a Javascript log in the browser console:


So, for example:

To disable Optimizely from running on a page:


So, for example:

optimizely_disable=true will prevent Optimizely from running.


The force parameter method is one of several outlined in the Pre-Launch Checklist. After you QA with force parameters, you should use the test cookie method to preview your changes in a live environment. Test cookie audience conditions adhere to all targeting conditions - including audience and url targeting - while force parameters bypass these conditions.

By default, force parameters will not work unless you uncheck the Disable the force variation parameter checkbox. This setting can be found by going to your Home page, then clicking the Settings tab and looking in the Privacy section.

Force a Variation of an A/B Test

When you're logged in to Optimizely, you can always preview a variation by clicking on the variation tab and selecting Preview. This will launch the page loaded in the Editor live on your site with the Optimizely preview console.

If you would like to force a variation to run without logging in to the Optimizely console, or you want a shareable link so colleagues can view a variation without logging in, you can use the force variation parameter. This method involves adding a query parameter to the end of any URL on your site. The parameter tells Optimizely which experiment and which variation to run when that page loads, regardless of any experiment targeting conditions (both audience targeting and URL targeting).

Want to see the force parameter in action? Watch this short video.


The query parameter takes the following form:


So, for example:

Experiment ID : This is the ID of the experiment you want to run, which can be found in the Editor URL (the 10 digit number in the URL when you're seeing your page is open in the Optimizely Classic Editor) as well as the experiment Diagnostic Report (in the Editor, go to Options, then Diagnostic Report).

Variation Index : This identifies the variation you want to run, where 0 is the original, 1 is for variation #1, 2 is for variation #2, etc.


The optimizely_x parameter disables tracking. If you use this parameter, you won't see any events firing in the Network tab of your browser console. If you want to track events, see optimizely_force_tracking=true under "Query Parameters at a Glance."

Force a Combination of Variations in a Multivariate Test

If you want to force yourself into a variation of a Multivariate Test (MVT), use the following format:

optimizely_xEXPERIMENTID=[VARIATIONINDEX for section 1]_[VARIATIONINDEX for section 2]_[VARIATIONINDEX for section 3]

and so on.

For example:

This will show variation 1 of section 1, the original of section 2, and variation 2 of section 3.

Experiments that are running

If you use this query parameter function on an experiment that is currently running, the variation that you force will render on the page and you will be cookied into the variation. If you were previously cookied into a different variation, using the force parameter will switch the cookie, and you will now be bucketed into the forced variation.

Conditional and manual activation with the force parameter

If you are Manually activating your experiment, the optimizely_x parameter will not activate your experiment. Your experiment will need to be running in order for you to force your variations, unlike immediate activation which allows you to force a variation on a paused experiment.

If you are Conditionally activating your experiment, the optimizely_x parameter will only activate the experiment if your activation condition is met (i.e. conditional activation code evaluates to true).