---
title: Target group visitor behaviors
slug: personalization/docs/target-group-visitor-behaviors
docTags: 
createdAt: 2026-08-05T20:59:36.948Z
---

- Optimizely Web Experimentation
- Optimizely Performance Edge
- Optimizely Personalization

You can target experiences to specific audiences based visitor behaviors in real-time, and create audiences based on what visitors do on your site.

In Optimizely Personalization, you can use behavioral targeting to deliver custom experiences to specific groups of visitors on your site based on their behaviors.

For example, suppose you want to behaviorally target an audience called "Luxury Travelers." Luxury travelers are visitors who purchase *bags* over *$200* in the las&#x74;*&#x20;30 days*.

Behavioral targeting for this audience in Optimizely Personalization takes only a few steps: 

- Create a [page](docId\:SLF-avIbJk1qR9hh8NU8_) in Optimizely Web Experimentation that targets product details for bags.
- Set up an add-to-cart [event](docId\:gq5wzoPd77xOJwNSfxqm8) for bags.
- Add price and subcategory [tags](docId\:laXaPRknYpQmadeDrTP0q) to tell Optimizely Web Experimentation when a visitor purchases bags of a certain value.

See [Prepare Optimizely Web Experimentation for your site](docId\:kxu9bdG1xng2sbZxoaOjx) for more information.

Target this specific behavior by creating a *Luxury Buyers* audience in Optimizely Personalization.

The following example shows how to set up a *Luxury Buyers* audience for visitors who have made a purchase priced at over *$500* in the *last 30 days*: 

1. Go to the **Audiences** dashboard. Click **Create New Audience**.
2. Name the audience *Luxury Buyers*. 
3. Under **Visitor Behaviors** in Audience conditions, select **Add to cart click**.
4. Add filters based on the **Price** tag.

   ![targeting-24.png](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/JtVbGEXC0cHzsY21XasTM-20260720-150155.png)
5. Click **Save Audience**.

## Behavioral events and browser local storage

Optimizely Web Experimentation stores events triggered by a visitor in their browser's local storage. This lets behavioral audience conditions be evaluated in real-time when the snippet is downloaded from the CDN and without requiring a separate targeting request.

You can access these events directly from the [behavior](docId:_kK0veAk1eNQdMVbT_Jjf) JavaScript API. This facilitates several valuable use cases, including:

- **Directly access values stored in event tags and use them in your variation code.**  For example, you might configure an event that tracks product detail page views. You could capture the URL of the product image using a tag. Then, create an Optimizely Personalization campaign on the homepage which uses the behavior API to access the product image tag from the most recent product detail page view event and displays the image in a promotional message.
- **Use&#x20;**[custom JavaScript audience conditions](docId\:zxtomDK20AHKs2xe8ifvt)**&#x20;to target complex user behaviors not supported in the audience builder.&#x20;**&#x46;or example, suppose you configure an event that tracks article views. You collect the category of the article using a tag. You want to target visitors who have viewed articles in at least three distinct categories. You can use the behavior API to count the number of unique values for the category tag as part of a Custom JavaScript audience condition, and use the audience to control your campaign. See [Customer Behavior](docId\:pp4AEU7AWkoHLhoirNwl4) for details on advanced queries supported by the behavior API.

Optimizely Web Experimentation retains up to 1,000 events per visitor in local storage. If a visitor triggers more than 1,000 events without clearing their local storage keys, Optimizely Web Experimentation drops old events to make room for new events.

## Behavioral audiences and campaign activation timing

Behavioral audiences are evaluated immediately each time the Optimizely Web Experimentation snippet activates, typically on the initial page load. This means that only those events that occurred before page load are used to calculate a visitor's membership in any behavioral audiences used by experiments and campaigns which subsequently activate on that page.

Suppose you create an audience called *Article Junkies* which uses the condition *Visitor converted on Viewed Article at least 2 times in the last 7 days*. You use this audience to target a personalized experience which is displayed on all article pages. You should expect that under these conditions, **the campaign will not activate until a visitor views their&#xA0;*****third*****&#xA0;article**. Why? Here is how it works:

1. Visitor views an article page and triggers a **Viewed Article** event.
2. Visitor views a second article page. When the page loads, Optimizely Web Experimentation checks behavior, sees \*one \***Viewed Article** event, and decides the visitor is ineligible for the personalization campaign. A second **Viewed Article** event is now triggered.
3. Visitor views a third article page. When the page loads, Optimizely Web Experimentation checks behavior, sees \*two \***Viewed Article** events, and decides that the visitor is eligible for the personalization campaign. A third **Viewed Article** event is triggered

If necessary, you can force Optimizely Web Experimentation to re-evaluate behavioral audiences after initial page load using the [activate](docId:_kK0veAk1eNQdMVbT_Jjf) JavaScript API method.
