Set up audiences using the Audience Builder

  • Updated
Relevant products:
  • Optimizely Web Experimentation
  • Optimizely Performance Edge

This topic describes how to:
  • Determine which visitors can be included in an experiment based on certain qualities about them
  • Create new audiences in Optimizely Web Experimentation and Optimizely Performance Edge or add existing ones to your experiments with the Audience Builder
  • Build audiences using conditions or custom code

Audiences in a nutshell

Audiences help you show your experiment to a specific group of visitors, based on conditions that you specify. For example, you might want your experiment to target visitors who saw a specific AdWords campaign. Or you might show an experiment to visitors on mobile devices only. 

Key tips 

What to watch out for

  • Most audience conditions are not "sticky," except Ad Campaign and New vs. Returning Visitor. Visitors are re-evaluated for that condition every time they return to the page.

  • A single experiment can have multiple audiences, but be careful. If a visitors meets the criteria for any audiences in an experiment, they can be included in it.

  • If you want to add multiple audiences, use an "OR" condition. Using an "AND" condition will result in creating one audience with more than one criteria.

In Optimizely Web Experimentation and Optimizely Performance Edge, an audience is a group of visitors that you define based on a set of shared traits, which are called audience conditions. For example, you might group all visitors who saw a certain ad campaign into an audience. Or, you might group visitors in a certain geographical region into an audience.

If you use Optimizely Performance Edge, certain features described in this article are not available to you. Optimizely Performance Edge is a lightweight experimentation product that delivers significantly faster performance than previous versions of Optimizely Experimentation. It does this by relying on a streamlined "microsnippet" which limits the range of available features.

You see this notation edge-info.jpg whenever the text describes a feature that is available in Optimizely Performance Edge.

Use audiences to control which visitors are eligible to enter an experiment and which are excluded. When you create an experiment or personalization campaign, you can target it to one or multiple audiences using AND and OR conditions.

Imagine that you're experimenting with a new video banner on the homepage of your site. You decide to exclude visitors on mobile devices from the experiment and include all new visitors and visitors who are in North America. If you have these audiences already, simply add them all to the experiment and specify how they'll be included or excluded instead of creating a new audience that specifically targets these conditions.

edge-info.jpg Create an audience with the Audience Builder

Choose the Audiences dashboard. If audiences were created, you will see them listed:


However, if you have not created a new audience before, your Audiences dashboard will look like this:


Click Add an Audience. The Create New Audience view appears where you define the conditions you want your visitors to meet to become part of the audience.

Name your new audience:


edge-info.jpg Add conditions 

Choose the conditions you want to use to define your audience. Under Conditions, select Standard to display a list of commonly-used condition categories.


You have a wide range of built-in criteria to work with. You can easily limit the audience for your experiment to visitors who use a specific browser, live in specific areas, or speak only certain languages, for example.

Imagine that you want to create an experiment that will only be visible to visitors who are located in certain cities. To do this, drag Location from Conditions to Audience Conditions, on the left.


Type in the name of the first location on your list. Locations can be countries, provinces, states or cities. You can add as many as you need.

You can also exclude specific areas from an audience. Simply select "is not in" from the Visitor drop-down list, and add locations as shown above.


edge-info.jpg AND and OR conditions 

You can always add more conditions to your audience requirements. Optimizely Web Experimentation and Optimizely Performance Edge provide two areas for you to add more conditions, depending on whether they are or or and conditions.


What is the difference? Any new conditions you add to the or conditions box will expand your audience (to include any visitor who meets your first set of conditions or your second set), while conditions added to the and conditions box will shrink your audience (by requiring audience members to meet both your first and second set of conditions).

For example, if you wanted to limit your audience to visitors who both live in the United States and is a returning visitor, you would add New/Returining Session to the and conditions box:


Under these conditions, only returning visitors who live in the United States will be bucketed into your experiment.

A "logged-in mobile visitors" audience may have two "AND" conditions: 

  • Platform / OS: Any mobile platform

  • AND

  • Cookie: loggedIn=true

Both must match for a visitor to be included in this audience.

A "French or Spanish visitors coming from Europe Vacation campaign" audience may have two "OR" conditions and one "AND" condition: 

  • Language: French

  • OR

  • Language: Spanish

  • AND

  • Query Parameter: utm_campaign=euroVacation14

Standard conditions 

Optimizely Web Experimentation's list of built-in standard audience conditions make it straightforward to create highly-specific, well-targeted audiences quickly:

  • Ad Campaign: Adds visitors to your experiment based on specific utm_campaign parameters.

  • Browser / Version edge-info.jpgAdds visitors to your experiment based on a visitors browser/version. You can choose to include or exclude visitors who are using specific browsers or versions of a browsers.

  • Cookie edge-info.jpgAdds visitors to your experiment based on whether they have a certain cookie, or whether the cookie is set to a certain value. Leaving the value section blank will target any cookie value, and just look for the presence of the cookie. Commonly used to target audiences based on logged-in status or other information passed through cookies.

  • Custom JavaScriptYou can write your own JavaScript condition that must be matched before an experiment is run. 

  • Device edge-info.jpgAdds visitors to your experiment based on a visitors device type. Choose between iPhones, other mobile phones, iPads, other tablets, or desktop/laptops.

  • IP AddressAdds visitors to your experiment based on their IP address range.

  • Language: Adds visitors to your experiment based on the preferred language choice (ex. en-us) that they set in their browser. This in effect lets you target by country.

  • List attributes: Lets you upload lists of query parameters, cookies, or ZIP codes and target experiments to visitors who match them.

  • Location: Adds visitors to your experiment based on their city, country, state, or region. Also known as Geotargeting.

  • New/Returning Session: Adds visitors to your experiment based on whether this is the first session in which they have been exposed to your Optimizely Web Experimentation snippet. Visitors who return in a different session later will become "returning" visitors.

  • Platform / OS edge-info.jpgAdds visitors to your experiment based on the platform or operating system they are using. Choose between mobile and desktop platforms.

    Optimizely Web Experimentation cannot differentiate between specific versions of operating systems because of limitations in what information we get from the web browsers (User Agent request header). For more information, see Chrome's developer documentation on user-agent reduction.
  • Query Parameters edge-info.jpgAdds visitors to your experiment based on whether they come to your page using a URL that contains a certain query parameter. Commonly used to target audiences based on SEM campaigns or other information passed through query parameters

  • Referrer URL: Adds visitors to your experiment based on the referrer website the visitor is coming from (ex. Google, Facebook, etc.)

  • Time/Day of Visit: Adds visitors to your experiment based on a specific day/time frame when they visit.

  • Traffic Source: Adds visitors to your experiment based on the referrer (campaign, search, referral, or direct). This feature may not be available on certain Optimizely Web Experimentation packages.

You can also create your own audience conditions in JSON. See the Code Mode section below for more information on how to do that.

Custom attributes 

You can also use custom attributes to describe key characteristics of your visitors, such as plan type, and use them to create audiences. 

Custom attributes are pieces of information about each visitor that your code detects and describes to Optimizely Web Experimentation via the JavaScript API. Each dimension can have have multiple values, such as Logged-In (with values True or False), or Elite-Status (None, Silver, Gold, 10k). They can be used for targeting audiences and segmenting results.

Visitor behaviors 

In addition to the standard conditions and custom dimensions, you can also define your audiences based on how visitors have interacted with your website in the past. For example, suppose you want to limit the audience to US visitors who have purchased in the last 30 days. To do that, click Visitor Behaviors under Conditions, and then drag Add to Cart into the and conditions box:


Visitor behaviors are available with any Optimizely Web Personalization plan. To learn more, check out Optimizely Web Personalization.

Code mode 

If you have particularly complex audience requirements that might be difficult to build with Optimizely Web Experimentation's drag-and-drop interface, you can create them by adding custom JSON in the Audience Conditions box. To do this, check Code Mode.


Type or paste your custom JSON in the code box.

When you finish specifying the conditions for your audience, click Save Audience.