Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySumbit a ticketLog In
GitHubNuGetDev CommunitySumbit a ticket
These docs are for v2.0. Click to read the latest docs for v3.0.


You can choose which types of users to include in an experiment or rollout using the Audiences feature in the Optimizely UI to create an audience. In that audience, you specify the attributes of users to include, such as their location, device type, or subscription plan, and then pass in these attributes when calling `Activate` or `Is Feature Enabled`. Optimizely uses the attributes to evaluate whether a user qualifies for an experiment, and also for segmentation on the Results page.

After creating an Audience, you can go to an [A/B test](🔗), [feature test](🔗), or [feature rollout](🔗) and choose which audience(s) to include. For more information, see the section on [Targeting Your Visitors](🔗) in our support documentation.

## Create an attribute

Use attributes to build the audiences that see your experiments, and use the Attributes tab to manage all your user attributes. **In Full Stack, you can have up to 100 attributes**.

To create a new attribute:

  1. Navigate to _Audiences > Attributes_.

  2. Click _New Custom Attribute_.

  3. Enter a key for the attribute. Attribute keys must be unique within your project. For example, an attribute for visitors located in the United States might be called "US_VISITOR". You can pass attributes to the Full Stack SDK in your code, so always make sure to update your code with any changes made to your keys.

  4. Click _Save_.

1456


## Create an audience

After you've created a few attributes, you can start building audiences. Audiences help you target your experiments to certain groups of users. You can reuse audiences that you've created across multiple experiments, but they’re limited to each Full Stack project.

Note

You do not need to pass audiences through the SDK. Optimizely infers audiences based on the attributes passed in the SDK.

To create an audience:

  1. Navigate to _Audiences > Saved_.

  2. Click _Create New Audience_.

  3. Drag and drop the desired attributes into the Audience Conditions field. For example, to create an audience of visitors who are located in the US, based on specific location values, add the "LOCATION" attribute.

  4. Define the attributes. Add other attributes to help create your audience. They can be can be added as "and" or "or" conditions. Currently, only string attributes are available, and the audience builder includes only exact matching.

  5. Click _Save Audience_.

1456


## Pass in attributes

The examples show how to pass in attributes to an SDK when calling either `Activate` or `Is Feature Enabled`.

Note

Attributes are defined based on a string `key` and take a string value. Be sure that you convert all attributes to strings before passing them in.



## Pass in attributes for segmenting results

If you define attributes and pass them in the SDK, they'll be available as segmentation options from the drop-down menu at the top of the Results page. See also [Analyze results: Segment results](🔗).

For example, you could use an `is_logged_in` attribute to measure how your experiment performed specifically for users who are logged in. This works most seamlessly if you also pass the user's attribute values when [tracking events](🔗).