# Divi

{% embed url="<https://www.youtube.com/watch?v=ddW12oSAReM>" %}

Setting up A/B tests in WordPress using the Divi Builder is a seamless process with Optibase. By using Divi’s built-in "Attributes" panel, you can easily define your variants and track performance without writing custom code.

***

### 1. Create Your Test in Optibase

1. Navigate to your Optibase Dashboard and click Create Test.
2. Name your test: For example, `Button Test`.
3. Select Type: Choose A/B Test (used for testing multiple versions of an element on the same page).
4. Click Next.

***

### 2. Define the Conversion Goal

A conversion is your "marker of success"—the specific action you want users to take.

1. Click Create Conversion.
2. Name it: e.g., `btn`.
3. Type: Select Click (the most common goal for button tests).
4. Count once per user: Check this if you are an agency or lead-gen site where one conversion per person is standard. Leave it unchecked for e-commerce.
5. Click Create Conversion.

Copy the Goal Attribute: `data-optibase-click-conversion-id="btn"`

***

### 3. Tag Your Elements in Divi

Open your page in the Divi Builder. Ensure you have both variants of your element (e.g., a Green Button and a Pink Button) ready on the page.

#### Step 3a: Add the Conversion Attribute

For both buttons:

1. Open the Button Settings > Advanced > Attributes.
2. Click Add Custom Attribute.
3. Attribute Name: `data-optibase-click-conversion-id`
4. Value: `btn`

#### Step 3b: Add Variant and Test IDs

Create your variants in the Optibase Dashboard (e.g., `green` and `pink`) and add the following attributes to each specific button in Divi:

| **Attribute** | **Value for Green Button**            | **Value for Pink Button**             |
| ------------- | ------------------------------------- | ------------------------------------- |
| Test ID       | `data-optibase-test-id="button-test"` | `data-optibase-test-id="button-test"` |
| Variant ID    | `data-optibase-variant-id="green"`    | `data-optibase-variant-id="pink"`     |

***

### 4. Launch and Verify

Once your attributes are saved and the Divi page is published:

1. Return to Optibase and set the test status to Active (or Scheduled for a future date).
2. The "Single Variant" Check: Visit your live page. If you only see one of the two buttons, the Optibase script is working correctly and hiding the other variant.
3. Live Verification: Perform a test click on the visible button. Check the Results tab in your dashboard; you should see the conversion tracked immediately.

***

### Advanced Dashboard Features

* Targeting & Restrictions: Narrow your test audience by location, device type (Mobile vs. Desktop), OS, or browser.
* Site-Wide Analytics: Monitor your overall traffic trends to see which devices and locations are driving the most engagement across your entire project.
* Agency Workspaces: If you manage multiple clients, create separate Workspaces for each. This keeps data, billing, and team members organized and isolated.
* Export Functionality: Need to present data to a client? You can export your raw test results directly from the settings tab.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.optibase.io/wordpress-plugin/divi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
