---
title: Debug variations by forcing behavior with query parameters
slug: personalization/docs/debug-variations-by-forcing-behavior-with-query-parameters
docTags: 
createdAt: 2026-08-05T20:59:35.632Z
---

- Optimizely Web Experimentation
- Optimizely Performance Edge
- Optimizely Personalization

Force parameters are disabled by default in Optimizely to help protect the privacy of your account.

:::hint{type="info"}
**Note**

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:

1. Go to **Settings > Implementation**.

   :::hint{type="info"}
   **Note**

   If you have custom snippets, you will have to edit the custom snippet by clicking the name, then go to **Privacy**.
   :::
2. Deselect **Disable the force variation parameter**. See[ information about that setting](docId\:BgxHHXMjh1J_RuV_wiMgy).
3. If you want to force variations for draft or paused experiments to display, select **Allow anyone to view draft or paused experiments**. Remember, this setting lets **anyone** view your draft or paused changes by adding `optimizely_token=PUBLIC`.
4. Append the query parameter to your site's URL. 
5. 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 display. 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
- Create a JavaScript log
- 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 the following.

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

## Query parameters

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.

```javascript
?optimizely_x=VARIATIONID
```

:::Paragraph{indent="1"}
For example, to see a Variation with the ID **1234567890** in an experiment:
`http://www.atticandbutton.us?optimizely_x=1234567890`
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:
`http://www.atticandbutton.us?optimizely_x=1234567890,9876543210`
With Performance Edge, you can use force parameters only on published and running experiments.
:::

- Enable tracking while using the force parameter

```javascript
?optimizely_force_tracking=true
```

:::Paragraph{indent="1"}
For example: `http://www.atticandbutton.us/?optimi..._tracking=true`
:::

- Force a variation or personalized experience from a draft or paused experiment to display.

```javascript
?optimizely_x=VARIATIONID&optimizely_token=PUBLIC
```

:::Paragraph{indent="1"}
For example, to see variation with ID **1234567890** of a draft experiment:
`http://www.atticandbutton.us?optimizely_x=1234567890&optimizely_token=PUBLIC`
To use this parameter, you need to [enable certain Privacy Settings](docId\:BgxHHXMjh1J_RuV_wiMgy).
:::

- Force yourself into a specific audience.

```javascript
?optimizely_x_audiences=AUDIENCESID
```

:::Paragraph{indent="1"}
For example, if your Audience ID is **1123581220** and you want to view an experiment or campaign as that audience:
`http://www.atticandbutton.us?optimizely_x_audiences=1123581220`
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).
:::

- Create a JavaScript log in the browser console

```javascript
?optimizely_log=true
```

:::Paragraph{indent="1"}
For example: `http://www.atticandbutton.us/?optimizely_log=true`
:::

- Disable Optimizely Web Experimentation and Optimizely Performance Edge from running on the page.

```javascript
?optimizely_disable=true
```

:::Paragraph{indent="1"}
For example:  
`http://www.atticandbutton.us/?optimizely_disable=true`
:::

:::hint{type="info"}
**Note**

To find experiment, variation, and audience IDs, go to [API Names](docId\:uu6zmA5Bkeqsq84hqUmL3) in your experiment or Optimizely Personalization campaign.
:::

## 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 `localStorage`.

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](docId\:BgxHHXMjh1J_RuV_wiMgy) in your project's privacy settings. 

```javascript
?optimizely_token=PUBLIC
```

:::hint{type="warning"}
**Important**

To use the public token, you must select **Allow anyone to view draft or paused experiments** in the **Project Settings**. Enable this setting with care because it lets *anyone* view your draft or paused changes by appending `optimizely_token=PUBLIC `to the Preview URL. Disable this setting after you finished testing.

Alternatively, use the [Share Link feature](docId\:G6SR7VF02w5hyw2yj0BLr) 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**:

`http: //atticandbutton.us/?optimizely_x=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:

`http://atticandbutton.us/?optimizely_x=2345678901&optimizely_token=PUBLIC`

## 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)
