# How to create server-side A/B tests

Prerequisites

* Ensure you have the necessary permissions to create and manage campaigns on the FE\&R platform.
* Install the [FE\&R SDK](/server-side/sdks/js-sdk/archived-versions/archived-js-v40x/archived-js-v40x-installation.md)

## Step-by-step guide

{% stepper %}
{% step %}

### Create a flag

1. Click on  **Flags** in the Feature Experimentation side menu.

   <figure><img src="/files/7EcGtKQ0oX0UAPIOLlvU" alt="" width="223"><figcaption></figcaption></figure>
2. Click on the **Create Flag** button

<figure><img src="/files/zkgyZuAL0N2ERR0u6vLQ" alt="" width="563"><figcaption><p>Fill in the requirements information to create the flag</p></figcaption></figure>

3. Fill in the requirements information to create the flag
   {% endstep %}

{% step %}

### Create a context key

Define a context key that identifies the user or session attributes used for segmentation in your test.

1. Click on **Context keys** in the Feature Experimentation side menu.
2. Click on the **Create key** button
3. Fill in the requirements information to create the key

<figure><img src="/files/65koOzUPoZz1Yi0i8KYr" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/AiS1R3F3ho10axsZTqk0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/HyoFdCXcLzWBr1VWsh5O" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create a campaign

1. Navigate to the AB Tasty dashboard.
2. Click on the **Create campaign** button.
3. Fill in the requirements information to create the campaign

{% hint style="info" %}
The **slug** refers to a custom ID that can be used when duplicating campaigns
{% endhint %}

<figure><img src="/files/owZTkCATRNXJdNq5k3rR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4yHEXGIMWZNRB9TLiiFK" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create variations

Create the different variations you want to test by specifying flags for each variations.

<figure><img src="/files/hoh9zU3ob0ZnwIFLiO8R" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Define goals

Define the objectives or metrics that you want to measure to determine the success of each variation.

<figure><img src="/files/k2JxkDTkHIb7MTN70dKU" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Learn more about [Goal management](/web-experimentation-and-personalization/campaign-flow-goals-step.md)
{% endhint %}
{% endstep %}

{% step %}

### Define Targeting

Configure the criteria for each segments of users tat should be included in the test. You can select target by:

1. User ID
2. Context Key
3. Selecting all users

<figure><img src="/files/JlZNFDu4auJURpRyoZHI" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Set traffic allocation

Determine the percentage of traffic that will be exposed to each variation.

<figure><img src="/files/KCSc2jilLNI1sxUmInzd" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Review the A/B test campaign details

Ensure all settings and configurations are correct before activating the test.

<figure><img src="/files/AxR58XVgTGGj9EWosR6G" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Activate campaign

Launch the A/B test by activating the campaign, and monitor the results through the FE\&R dashboard.

1. Click on the **Draft** drop-menu&#x20;
2. Select **LIVE** to launch the campaign

<figure><img src="/files/Tj53SfQGmUzLh4f9D02g" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# 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.abtasty.com/feature-experimentation-and-rollout/how-to-create-server-side-a-b-tests.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.
