---
url: 'https://dxpr.com/hc/documentation/learn-dxpr-builder/ai/create-experiment-variant'
title: 'Create an A/B test variant with AI Chat | DXPR'
author:
  name: docs-sync
  url: 'https://dxpr.com/users/docs-sync'
date: '2026-10-23T14:31:17+00:00'
copyright: 'Copyright DXPR. All rights reserved.'
type: article
summary: 'Let AI Chat write version B of a button or section for an A/B test'
tags:
  - 'Write and design with AI'
image: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
published: true
og:
  site_name: DXPR
  updated_time: '2026-10-23T14:31:17+0000'
  'image:alt': 'DXPR, powered by Drupal: AI-powered Drupal for marketers.'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      mainEntity: {  }
    -
      '@type': TechArticle
      headline: 'Create an A/B test variant with AI Chat'
      description: 'Let AI Chat write version B of a button or section for an A/B test'
      image:
        '@type': ImageObject
        url: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
        width: '1200'
        height: '630'
      datePublished: '2026-10-23T14:31:17+0000'
      dateModified: '2026-10-23T14:31:17+0000'
      author:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      mainEntityOfPage: 'https://dxpr.com/hc/documentation/learn-dxpr-builder/ai/create-experiment-variant'
      articleSection: 'Write and design with AI'
    -
      '@type': WebPage
      '@id': 'https://dxpr.com/hc/documentation/learn-dxpr-builder/ai/create-experiment-variant'
      description: 'Let AI Chat write version B of a button or section for an A/B test'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Home
            item: 'https://dxpr.com/'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
      inLanguage: en
---
[Help Center](/hc)/[Documentation](/hc/documentation) /[Learn DXPR Builder](/hc/documentation/learn-dxpr-builder) /[Build pages](/hc/documentation/learn-dxpr-builder/build) /[Write and design with AI](/hc/documentation/learn-dxpr-builder/ai) # Create an A/B test variant with AI Chat.

Let AI Chat write version B of a button or section for an A/B test

 Learn DXPR BuilderBuild pagesWrite and design with AI

   ## In this guide

 Related guides

- [Setting up tests](/hc/documentation/learn-dxpr-builder/integrations/setting-up-ab-tests)
- [Best practices](/hc/documentation/learn-dxpr-builder/integrations/ab-testing-best-practices)
- [Review and keep AI text](/hc/documentation/learn-dxpr-builder/ai/review-and-accept)

Let the AI write version B of a button, a heading or a section for an A/B test. You open **AI Chat**, pick its suggestion to try two versions or describe the variant yourself. The AI builds version B next to your original, version A. You compare both on the page and save. To build version B by hand instead, see [Set up an A/B test](/hc/documentation/learn-dxpr-builder/integrations/setting-up-ab-tests).

The video lets AI Chat write a second version of an Open Day registration button.

  ## Before you start

- AI is switched on, with **Enable page creation assistant** ticked. See [Turn on AI in DXPR Builder](/hc/documentation/learn-dxpr-builder/ai/setup).
- A/B testing works on your site: the RL module is enabled and **Reports** &gt; **Status report** (`/admin/reports/status`) says "rl.php is accessible". See [Set up an A/B test](/hc/documentation/learn-dxpr-builder/integrations/setting-up-ab-tests#before-you-start).
- The page is open for editing in DXPR Builder, so the builder toolbar shows.
- The page has the element you want to test, for example a button.

## Set up

1. Click **AI Agent** on the builder toolbar. The **AI Content Generator** panel opens.
2. Click **Chat mode** in the panel. The **AI Chat** sidebar opens.
3. Click the suggestion that starts with **Try two versions of**. You can also type a request such as "Create an experiment variant of the Register for Open Day button with a shorter call to action" and click **Send**.
4. Wait until the chat says "Content generated.".
5. Close the chat with **Close** at the top of the sidebar, then point at the button and click the **A** and **B** pills on the button's control bar to compare the two versions.
6. Click **Save** on the builder toolbar.

## What you see

The tested element gets the pills **A** and **B** on its control bar. **A** is your original, **B** is the AI's version. Click a pill to see and edit that version; a change to **B** leaves **A** as it was. The suggestions in the chat come from your page: they name a button or heading you already have.

To take the AI's change back, click **Undo** under "Content generated." in the chat. The chat answers "Reverted.". If the AI stops with an error or you cancel it, the new version is removed again.

Saving stores both versions. A variant on its own does not decide anything yet: visitors keep seeing version A until the test has a conversion. Choose what counts as a success with **More** &gt; **Experiment settings** on the tested element, then save, as described in [Set up an A/B test](/hc/documentation/learn-dxpr-builder/integrations/setting-up-ab-tests). From then on each visitor sees one version, and [Analyzing results](/hc/documentation/learn-dxpr-builder/integrations/analyzing-results) shows which one works better.

## If you don't see version B

- **The suggestion is greyed out and says "A/B testing needs the RL module. Install it to run experiments."** The RL module is not enabled. Ask your site administrator to enable it.
- **The suggestion is greyed out and says "A/B test results are not being collected. Open the status report to see what to fix."** The site cannot reach `rl.php`. Check **Reports** &gt; **Status report** (`/admin/reports/status`).
- **There is no AI Agent button or no Chat mode.** AI or **Enable page creation assistant** is off. Ask your site administrator, see [Turn on AI in DXPR Builder](/hc/documentation/learn-dxpr-builder/ai/setup).
- **There is no Try two versions suggestion.** The chat only suggests it on a page that has content, and only when the chat has no earlier conversation. Type the request yourself, or click **Chat History** and **+ New chat**.
- **The AI changed the button instead of adding version B.** The request did not ask for a test. Click **Undo** in the chat and ask for "an A/B test variant" or "an experiment variant".
- **No variant is made for an element that already has A and B.** An element can have one test, and tests cannot sit inside each other. The AI then edits the existing versions. Pick another element or remove the old test first.

## What's next?

- [Set up an A/B test](/hc/documentation/learn-dxpr-builder/integrations/setting-up-ab-tests): choose the conversion and start the test.
- [A/B testing best practices](/hc/documentation/learn-dxpr-builder/integrations/ab-testing-best-practices): what to test and for how long.
- [Review and keep AI text](/hc/documentation/learn-dxpr-builder/ai/review-and-accept): check what the AI wrote before visitors see it.