> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/feature-experimentation-and-rollout/campaign-creation/how-to-create-server-side-a-b-tests/targeting.md).

# Targeting

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

The **Targeting** step allows you to control **who will see your A/B test campaign**.

During this step, you define which users are eligible to enter your campaign based on specific rules.

### Configuration

In the targeting step, you define **who will see your campaign** using a simple rule-based system.

{% stepper %}
{% step %}

#### Define your targeting

There are **three ways to configure targeting**:

* **All users**\
  Make your campaign eligible for **all users**.
* **User by ID**\
  Target **specific users only**, based on their unique identifier.\
  This ID is the one sent in your implementation:\
  `visitorData={{ id: "<VISITOR_ID>" }}`
* **Key**\
  Target users based on [**User Context attributes**](/feature-experimentation-and-rollout/managing-context-keys.md).\
  These values are sent through the `context` object in your implementation:\
  `context: { isVIP: true, country: "NL", loginProvider: "Google" }`

  This option allows you to build **advanced segmentation** based on user properties.
  {% endstep %}

{% step %}

#### Define your conditions

For **User by ID** and **Key** targeting, rules are built using:

* A **Key** (e.g. `isVIPUser`, `subscription`, `userId`)
* An **operator** (e.g. *is*, *contains*, *equals*)
* One or several **values** (e.g. `true`, `Gold`, `Premium`, `123`)

**Examples:**

* `isVIPUser is true`
* `userId contains 123 OR 456`&#x20;

{% hint style="info" %}
You can import targeting values (e.g. lists of user IDs) using the **“**[**Import from CSV file**](#user-content-fn-1)[^1]**”** option, which is especially useful for large audiences.
{% endhint %}
{% endstep %}

{% step %}

#### Combine conditions

You can structure your targeting using:

* **AND** → all conditions must be true
* **OR** → at least one group of conditions must be true
  {% endstep %}

{% step %}

#### Use existing or new keys

You can:

* Select an **existing key** already used in your implementation
* Or use a **new key**, as long as it is sent via your SDK or API

There are two main types of keys:

* **Technical keys**: device, OS, app version, location…
* **Behavioral keys**: VIP status, subscription, user type…

{% hint style="info" %}
Targeting keys must be sent through your implementation. Keeping consistent naming across campaigns ensures better targeting and clearer reporting
{% endhint %}
{% endstep %}
{% endstepper %}

#### Example use case&#x20;

You want to roll out a feature progressively:

1. Start with internal users → `userType = internal`
2. Expand to early adopters → `userType = earlyAdopter`
3. Roll out to all users → `All Users` (or broader conditions)

This approach helps you **reduce risk, validate impact, and scale safely**.

[^1]:


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/campaign-creation/how-to-create-server-side-a-b-tests/targeting.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.
