> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a prompt-based experiment

> Learn how to create AI-powered experiments in minutes by writing natural language prompts.

You can create AI-powered experiments in minutes by writing a simple prompt—no coding needed.

For a guided tour of prompt-based experimentation in Kameleoon, click [here](https://kameleoon.navattic.com/dac08g2).

## Access the creation flow

1. In the Kameleoon app, go to **Experiences** > **A/B Test** > **New experiment**.
2. If you use the Starter or Trial plan, the prompt-based interface opens automatically.
3. If you use the Enterprise plan, a pop-up appears. Select **By Prompt**.

<Note>
  You cannot use the Graphic editor to edit a variant that PBX generates. For more information, see the [FAQ](/user-manual/experimentation/web-experimentation/prompt-based-experiments/prompt-based-experimentation-faq#can-i-use-the-graphic-editor-on-a-variant-created-with-ai).
</Note>

<Frame>
  ![](https://help.kameleoon.com/uploads/user-manual/images/experimentation/web-experimentation/prompt-based-experimentation/create-a-prompt-based-experiment/new-experiment.png)
</Frame>

4. Enter the required information and click **Create**.

<Tip>
  If you use PBX without the Kameleoon script installed, refer to the [PBX FAQ](/user-manual/experimentation/web-experimentation/prompt-based-experiments/prompt-based-experimentation-faq#can-i-create-a-prompt-based-experiment-without-installing-the-kameleoon-script) for guidance.
</Tip>

## Configure your experiment

### 1. Define your prompt

In the prompt field, describe the modification you want to make using natural language. You can resize the prompt area by clicking and dragging the corner.

**Examples:**

* *“Update the product listing grid to display 2 products per row instead of 4.”*
* *“Change the default sorting option to ‘Price, low to high’.”*

By analyzing your website and existing visual assets, Kameleoon automatically detects and maps your brand identity, including your tone of voice, fonts, imagery, and color palette.

#### Use images and designs

To provide visual context or add specific assets (like banners or pop-ups), click **+** > **Add an image** or paste an image from your clipboard.

<Frame>
  ![](https://help.kameleoon.com/uploads/user-manual/images/experimentation/web-experimentation/prompt-based-experimentation/create-a-prompt-based-experiment/draw-sketch.png)
</Frame>

When you upload or paste an image and submit a prompt, PBX asks how to use it:

* **Asset:** PBX inserts the image file directly into the variation.
* **Mockup:** PBX uses the image as a reference to recreate the design with code.

To preview an uploaded image, click it in the prompt area. You can also click **Copy reference** to copy the image link.

You can also import Figma designs directly. For more information, see [Import designs from Figma](./import-designs-from-figma.mdx).

<Tip>
  For details on prompt limitations, see the [PBX FAQ](/user-manual/experimentation/web-experimentation/prompt-based-experiments/prompt-based-experimentation-faq#can-i-create-any-type-of-variant-with-prompts).
</Tip>

#### Select elements

Help the AI identify which elements to modify in two ways:

* **Text description:** Describe the element in your prompt (for example, *"Move the product grid below the banner"*).
* **Selection box:** Click **+** > **Draw sketch** and outline the target element on the page. Use the toolbox to draw, erase, or delete your selection.

<Note>
  You cannot scroll or draw outside your current view when using the drawing tool. Use text descriptions for elements located lower on the page.
</Note>

#### Configure AI Settings

Customize how the AI generates variants and interacts with your website. Click the **+** icon and select **AI Settings**. In the **Projects** sidebar, select the project you want to edit.

The AI Settings menu includes two tabs:

* **Master Prompt:** Define overarching instructions and context for the AI. For more information, refer to the [Master Prompts](./master-prompts.mdx) article.
* **Technical Settings:** Configure technical preferences for your project. You can adjust the following options:
  * **Website adapts automatically to different screen sizes:** Enable this option for responsive websites. Disable it if your mobile version uses a separate URL or does not update on resize.
  * **Enable support for dynamic websites (SPA, PWA...):** Enable this option to detect virtual URL changes and ensure URL targeting and data collection work correctly.
  * **Custom attribute:** Set a custom attribute to allow Kameleoon to track every virtual URL change, enable URL targeting, and gather data, such as the number of page views.
  * **Avoid dynamic IDs selectors:** Specify selectors to avoid.

Click **Save** to keep your changes, or click **Back to the editor** to return to the editor interface and discard any changes.

#### Generate optimization ideas

To get suggestions for your page:

1. Type a prompt such as *"Suggest ideas to optimize this page."*
2. Review the list of actionable improvements generated by the AI.
3. Click **Regenerate** for new ideas or **Cancel** to use a different prompt.

<Tip>
  For information on why the same prompt can lead to different outcomes upon regeneration, refer to [this PBX FAQ entry](/user-manual/experimentation/web-experimentation/prompt-based-experiments/prompt-based-experimentation-faq#why-can-the-same-prompt-lead-to-different-outputs-when-tried-multiple-times).
</Tip>

#### Build variants in parallel

Build multiple variants simultaneously. While one variant generates, you can immediately start another. A loading icon indicates progress, and Kameleoon notifies you when each variant is ready.

### 2. AI workflow

When you submit a prompt, PBX:

* Identifies the target elements.
* Generates technical specifications (accessibility, responsiveness, and QA steps).
* Creates the required JavaScript and CSS updates.

PBX then displays a summary of the changes. The AI might ask clarifying questions (for example, about image preference or content types) to ensure the result matches your intent before it applies changes.

#### Create from sketches

Design components like pop-ups or overlays by drawing them directly on the page:

1. Click **+** > **Draw sketch**.
2. Draw your design.
3. Prompt the AI to build it (e.g., *"Build the popup based on my sketch"*).

Follow [best practices for writing prompts](/user-manual/experimentation/web-experimentation/prompt-based-experiments/pbx-build/how-to-write-effective-prompts-dos-and-donts) to get the best results.

### 3. Review and adjust the generated code

<Frame>
  ![](https://help.kameleoon.com/uploads/user-manual/images/experimentation/web-experimentation/prompt-based-experimentation/create-a-prompt-based-experiment/css-js.png)
</Frame>

Click the **Code** icon in the top-right, or click the **`[CSS]`** or **`JS`** code icons in the generation panel. Click **`CSS`** or **`JS`** to view and edit the relevant code. Click **Edit code** to make changes.

<Frame>
  ![](https://help.kameleoon.com/uploads/user-manual/images/experimentation/web-experimentation/prompt-based-experimentation/create-a-prompt-based-experiment/code-editor.png)
</Frame>

If you prompt several times and generate multiple versions for a given variant, you can switch between those variants using the dropdown in the top-left of the code panel.

Once the AI generates content for your experiment, you can refine its output by editing the underlying code.

<Tip>
  To refine a variant using prompts instead of code, see the [FAQ](/user-manual/experimentation/web-experimentation/prompt-based-experiments/prompt-based-experimentation-faq#my-first-prompt-didnt-generate-the-right-output-can-i-submit-additional-prompts-to-fix-whats-incorrect).
</Tip>

### 4. Compare and simulate

Use the header buttons to switch between views:

* **Website display:** Preview the variant appearance.
* **Code:** View the technical implementation.
* **Compare:** Compare different variations side-by-side.

<Frame>
  ![](https://help.kameleoon.com/uploads/user-manual/images/experimentation/web-experimentation/prompt-based-experimentation/create-a-prompt-based-experiment/views.png)
</Frame>

Click **Simulate** to test the experiment live on your website before launching.

#### Share your experiment

<Frame>
  ![](https://help.kameleoon.com/uploads/user-manual/images/experimentation/web-experimentation/prompt-based-experimentation/create-a-prompt-based-experiment/share.png)
</Frame>

Click the **share icon** in the top-right to:

* **Copy link:** Share a direct link to the experiment.
* **Share on LinkedIn:** Post your experiment directly to your feed.

## Finalize the experiment

Once your variation is complete:

1. Click **Finalize**.
2. Set your goals, audience targeting, and traffic allocation.
3. Launch your experiment.

You are now ready to experiment faster than ever, with no code and no delay.
