Skip to main content


Optimizely Knowledge Base

Set up audiences in Optimizely Classic

  • Determine which visitors can be included in an experiment based on certain qualities about them
  • Create new audiences in Optimizely Classic or add existing ones to your experiments
  • 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've seen 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 aren't "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 forany 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, an audience is a group of visitors that is defined by a shared trait or characteristic. You can set up and use audiences to control which groups of visitors are bucketed into an experiment, and which groups will view your original site instead. In this way, you can narrow the focus of your experiments to test hypotheses that are relevant for certain visitors, but not others.

For a quick overview on how audiences work, check out this video:


Create Audiences

Optimizely gives you three different ways to create a new audience. This section will describe each of them, before moving on to an explanation of how to set the conditions for your newly-created audience.

From the Audiences tab

You can create a new audience even before you start an experiment. From the Overview > Audiences tab in the Home page, click the New Audience button.

Screenshot - new audiences button

Optimizely will open the Create New Audience window. This is where you'll define the conditions you want your visitors to meet in order to become part of the audience for this experiment, which is covered in the next section of this article.

Screen shot - create new audiences window

From the Experiments tab

In the Overview > Experiments tab, click Edit next to Audiences in the right-sidebar.

screen shot - edit audiences

Optimizely will give you the option to add a previously-saved audience to your experiment, or to create a new audience from scratch. Click the Create a New Audience button.

screen shot - experiment audiences window

The Create New Audience window (pictured above) will open.

From the Editor

Finally, you can also create a new audience from within the Editor itself. Just click the Audiences icon in the upper-right corner of your browser.

screen shot - audiences button in editor

Once again, you'll have the option to add a saved audience that you've already created, or to create a new audience from scratch. Click the Create a New Audience button.

Add conditions

Next, you'll choose the conditions you want to use to define your audience.  Under Conditions, select Standard to reveal a list of commonly-used condition categories.

screen shot - standard conditions

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.

screen shot - adding location to conditions

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.

screen shot - location condition for audiences

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.

screen shot - exclude drop down menu

You can always add more conditions to your audience requirements. Optimizely X provides two areas for you to add more conditions, depending on whether they are 'or' or 'and' conditions.

screen shot - and/or conditions

What's 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 a) live in a specific set of cities, and b) use a specific operating system, you would add Platform / OS to the 'and' conditions box:

screen shot - platform added as condition

Under these conditions, only visitors who use Linux and live in one of the cities you selected (in this example, Detroit, Austin, Salt Lake City, Worcester or Asheville) will be bucketed into your experiment.

More Examples of AND and OR Conditions

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'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, as described in our article on Dimensions.
  • Browser / VersionAdds 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.
  • CookieAdds 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 Events: Capture and report on visitor actions or events not exclusively related to clicks or page views.
  • Custom JavaScriptYou can write your own JavaScript condition that must be matched before an experiment is run. 
  • Custom TagsYou can set audiences based on unique information about a visitor or a page.
  • DeviceAdds 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.
  • LanguageAdds 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.
  • 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 snippet. Visitors who return in a different session later will become "returning" visitors.
  • Platform / OSAdds visitors to your experiment based on the platform or operating system they are using. Choose between mobile and desktop platforms or specific opterating systems like Windows or OSX.
  • Query ParametersAdds 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 URLAdds 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 SourceAdds visitors to your experiment based on the referrer (campaign, search, referral, or direct) described in our article on Dimensions. This feature may not be available for certain Optimizely Classic packages.
  • Uploaded Audiences: Lets you upload lists of query parameters, cookies, or ZIP codes and target experiments to visitors who match them.

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 dimensions

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

Dimensions are pieces of information about each visitor that your code detects and describes to Optimizely 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 as well as 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, maybe you want to limit the audience for an experiment to viewers who have visited your site's home page recently. To do that, click Visitor Behaviors under Conditions, and then drag Home into the Audience Conditions box. 

screen shot - visitor behavior

Code mode  

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

screen shot - code mode

Type or paste your custom JSON in the code box.

Once you've finished specifying the conditions for your audience, click Save Audience.

Congratulations - you've created your first audience!