---
title: Example - Using A/B testing
related:
  - https://docs.kentico.com/k8/on-line-marketing-features/optimization-testing/a-b-testing-website-pages/creating-a-b-tests-for-pages.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

> **Info:** **Kentico EMS required**
>
> Features described on this page require the **Kentico EMS** license.

The following example demonstrates how the A/B test included on the sample Corporate Site works.

The first part shows how the test looks from the live site perspective once it is started. [Part 2](#part-2---creating-an-ab-testing-page-variant) shows how to create a new page variant and add it to the test.

## Part 1 - Live testing

The testing scenario is very basic, with the page being composed of a text column on one side and a link on the other. The layout is reversed on the page variant and the goal of the test is to find out which version gets more link clicks from visitors.

1. Open the **Pages** application and select the **A/B test** document under **Examples -> On**\*\*‑\*\***line marketing -> Optimization**.

   1. This document already has an A/B test defined and one page variant added as a child document.
2. Switch to the **Analytics -> A/B tests** tab.
3. Edit () the **Sample AB Test**.
4. Check the **Start test** and close the dialog.
5. View the page on the live site. When you view the tested page, the system randomly selects and displays one of the two possible variants.
6. Click the **Download here** link.

   - A conversion is logged for the given page variant by the sample **Conversion page**.
   - If you return to the A/B test page, the same variant that was assigned during the first visit will always be displayed.
7. Open the same page using a different browser.

Again, the page automatically chooses and displays one of the variants. Please note that it may be the same variant as before, since the selection process is entirely random. You can simulate visits from multiple users by clearing the cookies from your browser between views of the tested page. Try to use this approach to log several conversions for each variant.

See [Analyzing A/B test results](https://docs.kentico.com/k8/on-line-marketing-features/optimization-testing/a-b-testing-website-pages/analyzing-a-b-test-results.md) to learn how you can view the results measured for the sample test.

## Part 2 - Creating an A/B testing page variant

This part of the example demonstrates how you can add another variant to the test used in the section above.

**Note**: It is generally not recommended to add, remove or otherwise modify the variants of a running test, since this may affect the accuracy of the results.

1. Open the **Pages** application and select the **A/B test** document again (under **Examples -> On**\*\*‑\*\***line marketing -> Optimization**).
2. Click **New** () in the menu above the content tree and choose the **A/B test page variant** option below the list of possible document types.
3. Enter _Second variant_ into the **Document name** field and leave the default values for the remaining properties.
4. Click **Save**.

   - The system creates the variant as a child under the currently selected document and assigns it to the _Sample AB Test_.
   - By default, new variants added this way use an ad-hoc page template that is copied from the parent document.
5. Switch to the **Design** tab.
6. Rearrange the web parts on the page.

You can also make any necessary changes to the text content on the **Page** tab.

The variant serves as a third option for visitors of the tested page. You can use the approach described in the first part of the example to try out the functionality of the A/B test now that it has an additional page variant.
