---
title: Target audiences in Feature Experimentation
slug: feature-experimentation/docs/target-audiences-in-feature-experimentation
docTags: 
createdAt: 2026-08-05T20:39:56.000Z
---

- Optimizely Feature Experimentation

Audiences give you control over which users can access your flag rules, for example, [A/B tests](docId:8pnfCv-sR37goLcxTtCPv), [targeted deliveries](docId:_BjMxuGwwlVrhkNcx2kzm), or [multi-armed bandit optimizations](docId\:F5-ZUIoxCu2_XRy26tO-b).

A single audience is defined based on custom user attributes you create. These can be based on location, device type, subscription plan, and so on. When you call user-based methods like `Decide` and `Track`, Optimizely Feature Experimentation determines whether a user qualifies for a flag by evaluating the attributes.

## Create an audience

After you have [created and implemented a few attributes](docId\:o2PfkAKSRc0TOAzllcRQN), you can start building audiences. You can reuse audiences that you create across multiple flags and rules.

## Audience match conditions

Optimizely Feature Experimentation supports several match comparison operations that you can use in audience conditions:

- `has any value`
- `String equals`, `String contains substring`
  - `String equals` is the only match type that is compatible with SDK version releases before March 2019 (pre-3.0.0 releases for *most* major SDKs). See the [SDK Compatibility Matrix](docId:2shbZfPCkPAZ0mlZpL1TU).
- `Boolean is false`, `Boolean is true`
- `Number equals`, `Number is less than`, `Number is less than or equal to`, `Number is greater than`, `Number is greater than or equal to`
  - For SDK version compatibility with "or equal to" comparisons, see the [SDK Compatibility Matrix](docId:2shbZfPCkPAZ0mlZpL1TU).
- `Version equals`, `Version is less than`, `Version is less than or equal to`, `Version is greater than`, `Version is greater than or equal to`
  - See the [SDK Compatibility Matrix](docId:2shbZfPCkPAZ0mlZpL1TU) for SDK version compatibility.
  - You can use `version` to target audiences based on the version of your application that they use. You must implement the attribute in your code by passing in your application's [semantic version specifications](https://semver.org/) as a string to Optimizely Feature Experimentation.
    - You can pass versions in the format `"major.minor.patch-prerelease+build"`, where `patch`, `prerelease`, and `build` are optional. For example, you can pass `"3.0"` or `"1.5.1-beta"` or `"2.0.5-alpha+001"`.

While attributes are not explicitly typed in Optimizely Feature Experimentation, you must pass in values of the correct type and format for your audience conditions to evaluate correctly. An attribute value of the incorrect type will result in a false-y audience evaluation.

The **Edit Audience** window lets you define audience conditions by dragging and dropping attributes from the side panel or defining complex JSON objects using the **Code Mode** window.

## Build audiences from attributes

To create audiences from attributes:

1. Go to **Audiences > Saved**.
2. Click **Create New Audience**.

   ![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/WBnPRMQ6adeuvHFBak_7X-20260720-154753.png)
3. Drag and drop your previously created [attributes](docId\:o2PfkAKSRc0TOAzllcRQN) into the **Audience Conditions** field.

   ![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/_8XXPWVcvHzuwqrZ2GkhO-20260720-154753.png)
4. Select the match condition. See the [Audience match conditions section](docId\:UDBvr5a8WHNkyOqzPhOr9).
5. Add other attributes to create your audience. They can be added as `and` or `or` conditions.
6. Click **Save Audience**.

:::hint{type="info"}
**Note**

When you choose any match type option other than `String equals` for exact matching, a message displays that the option requires using an SDK version of 3.0.0 or higher for most SDKs. See [SDK Compatibility Matrix](docId:2shbZfPCkPAZ0mlZpL1TU).
:::

After creating an audience, you can set the target audience or audiences for flag rules.

## Create audience combinations

When adding your audience to a flag, you can use `and` or `or` operators (`any` or `all`) to create a combination of other audiences.

1. From **Flags**, click or create a flag.
2. Select or create a rule.
3. Under **Audiences**, select an audience.
4. Add another audience. Adding more than one audience per rule creates an audience combination.
5. From the **Match** drop-down list, select **any** or **all**.

   ![creating an audience combination](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/RXYFMFFuPQvgy-e3Hr70v-20260720-154753.png)

If you want to use more complex nested logical operators with `and` or `not`, you can do so in JSON in **Code Mode**. See [Create advanced audience combinations](docId\:f-kDrilUaQvTtUINK2Wk1).

## Edit an audience

In Feature Experimentation, complete the following:

1. Go to **Audiences**.
2. Click an audience you want to edit.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/2kGEwh4bFMqxTpKwxkGyN_zd-44716545039757.png)

3. Update the audience.
4. Click **Save Audience.**

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/x_pMtBiwdrqqcfA2-LgU3_zd-44716545041165.png)

If the audience is in use in a rule, Feature Experimentation displays a callout telling you how many rules are associated with the audience and warning you that updating the audience may change user targeting and influence experiment results.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/TqO4Lyy4oxpO7z41oncy5_zd-44716545042829.png)

 Click the number of rules to view which rules use the audience.

::Image[]{src="https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/ahR_AZMVBXOLBypoupTSF_zd-44716530245389.png" size="60" isUploading="false" darkWidth="1330" darkHeight="496" width="1330" height="496" showCaption="false"}

## Advanced audience information

### Excluding audiences

You can use audiences to *include* users but not *exclude* them.

For example, you cannot exclude "all Desktop users" by dialing back traffic to 0% for that audience. This is because if you toggle off audience evaluation for Desktop users, they end up in the "Everyone" audience.

To actually *exclude* or blocklist audiences, you can define advanced audience combinations with `not` using **Code Mode**. For information, see [Create advanced audience combinations](docId\:f-kDrilUaQvTtUINK2Wk1).

### Overlapping audiences

If you define multiple, overlapping audiences and multiple rules for a single flag, then how a single user successively evaluates against the rules can get complicated. For information, see [Interactions between flag rules](docId:_4OpAAw99L5HVhT-OCJTW).

### Nested logical operators

If you want to use nested logical operators (`and`, `or`, `not`) to create audience combinations, you can do so in **Code Mode**. Each audience is a rule like `User likes salads`, and an audience combination is a boolean combination of these rules, like `User likes pizza NOT (User likes sandwiches AND User likes soup)`.

For information, see [Create advanced audience combinations](docId\:f-kDrilUaQvTtUINK2Wk1).
