# Gutenberg

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

Using Optibase with the WordPress Block Editor (Gutenberg) is a simple way to optimize your pages. Because Gutenberg does not support custom HTML attributes by default, this guide includes the extra step needed to tag your blocks correctly.

***

### 1. Prerequisites

Before you start, ensure you have the following installed:

* Optibase WordPress Plugin: Connects your site to your workspace.
* Attributes for Blocks Plugin: A free utility (linked in our dashboard) that allows you to add custom attributes to standard Gutenberg blocks like buttons and sections.

***

### 2. Create Your Test in Optibase

1. In your Optibase Dashboard, click Create Test.
2. Name your test: (e.g., `Button Test`).
3. Select Type: Choose A/B Test and click Next.

***

### 3. Set Up Your Conversion Goal

1. Name the conversion: (e.g., `btn`).
2. Type: Select Click.
3. Count once per user: Keep this checked for most leads/sign-up tests.
4. Click Create Conversion.

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

***

### 4. Tag Your Gutenberg Blocks

Open your WordPress page editor and create the two buttons (or sections) you want to test.

1. Select the first button: Go to the Advanced tab in the block settings sidebar.
2. Add Attributes: Under "Additional Attributes," add the following:
   * Goal: `data-optibase-click-conversion-id` with value `btn`
   * Test ID: `data-optibase-test-id` with value `btn-test`
   * Variant ID: `data-optibase-variant-id` with value `btn1`
3. Select the second button: Repeat the process, but change the Variant ID value to `btn2`.

\[Image: Gutenberg sidebar showing the Advanced > Additional Attributes section with Optibase tags]

***

### 5. Launch and Verify

Once your page is saved and published:

1. Return to Optibase and set the test status to Active.
2. The "Single Button" Check: Visit your live page. If only one button is visible, the script is working correctly and hiding the other variant.
3. Live Verification: Perform a test click on your button and check the Results tab in your dashboard. You should see the "Tested User" and "Conversion" counts update almost immediately.

***

### Pro Features

* Auto-Stop: Configure your test to automatically end when a specific conversion rate (e.g., 9%) is achieved.
* Targeting: Use Restrictions to only run the test for users on specific browsers or in certain geographic locations.
* Data Accuracy: Use the IP Blacklist in Workspace Settings to exclude your own office traffic so your test results remain pure.
* Domain Whitelist: Secure your account by ensuring your tracking script only runs on your authorized domains.


---

# 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/gutenberg.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.
