---
title: Integrate real-time audiences for Feature Experimentation
slug: feature-experimentation/docs/real-time-audiences-for-feature-experimentation
docTags: 
createdAt: 2026-08-05T20:40:00.000Z
---

## Prerequisites

To use Real-Time Audiences for Feature Experimentation, complete the following:

- Have a Feature Experimentation account.
- Maintain an Optimizely Data Platform (ODP) account.
- Configure [real-time audiences in ODP](docId\:chCPcgJQ5k5t6nUgnnd43).
- Choose your customer data platform (CDP). See the [Integrate with other CDPs](docId\:IECm8WmxPiCbCBg63cQTl) section.
- Review how ODP handles user data and real-time audiences. See ODP's [end-user documentation](docId\:eJ9NFnxBeytWY04EiLqHN) and [developer documentation](docId\:qhZVZwWDbjlj73Ap7qzGv) to learn more.

## Introduction

With Real-Time Audiences for Feature Experimentation, you can segment your audience based on their behaviors, interactions, and preferences.

By using ODP's [real-time audiences](docId:7-qDl01uxXDPl5_jFVF1E) through [CDP audience sync](docId\:jUx2QP7GrcRvtlRjQeXQ7), you can create detailed audiences to target specific users in your [flag rules](docId:-yq2-thNRv7-SgwCXpG90) without increasing the size of your project's [datafile](docId:3LmHm4b3kTxKBuoR93KN8).

If you are using a client-side Feature Experimentation SDK (Android, Swift, Flutter, or JavaScript), you can enable anonymous targeting, which lets you target anonymous users without using personally identifiable information (PII). See [VUIDs and anonymous targeting](docId:6UBBxxRv331nBIVZ2lun8) for more.

## Integration architecture

The following diagram shows the flow of real-time audience data between an external CDP, ODP, and Real-time Audiences for Feature Experimentation.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/cZG_nh5MvHICSjk6XCLxQ_a72d56f-real-time-segments-3.png)

## Implement the Real-Time Audiences for Feature Experimentation integration

### Integrate with other CDPs

:::hint{type="warning"}
**Important**
If you use ODP as your CDP, do not complete this section. Skip to the [Enable Real-Time Audiences in Feature Experimentation](docId:6UBBxxRv331nBIVZ2lun8) section.
:::

If you use a CDP other than ODP, configure ODP to automatically create real-time audiences based on your identifiers from the CDP.

1. Configure the CDP integration in ODP.
   - [Amplitude Audience Sync](docId\:F7iZXgmRIXarIbk7pEmCJ)
   - [mParticle Segment Sync](docId\:kRV5dqAIH4uaNGcV0nxFE)
   - [Mixpanel](docId\:ja9qOn_lIxDoCtDEW3WzI)
   - [Tealium](docId\:UzccHrMm6umCuHwI5Cqp2)
   - [Twilio Segment Engage audiences](docId\:ETgUdEFE8O4g1fKkUv80Y)
   - [Zeotap Segment Sync](docId\:xlRu-mQMyCfjJ9XGcZiny)
2. Follow steps 1-8 in the following section.

### Enable Real-Time Audiences in Feature Experimentation

Complete the following steps in the [Optimizely application](https://app.optimizely.com/v2).

1. Select the Feature Experimentation project for which you want to enable the integration.
2. Go to **Settings > Integrations > Data Platform Real-Time Audiences** .
3. Toggle the integration status to **On**.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/YMdaIBxkXpOWRbHOqXo-D_cb5ed6a140583cb78d3520f25cc3916956255f2c7a00bc069167e7b3655b04eb-image.png)

4. Click **Accept** on the **Turn on Integration** confirmation window.

### Configure Real-Time Audiences in Feature Experimentation

After enabling the integration, complete the following:

1. Click **You can find your API key in Optimizely Data Platform (ODP)** to go to the **APIs** page in ODP.

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

2. Copy the value in the **KEY** field for *both* the **Public** and **Private** tabs on the **APIs** page in ODP.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/4LHqOuTZr64URcqpMkXMj_46ff1d3f4ebaf657d657c14507ba1ea83d15befe2233731c7eafcd72bd8c0422-image.png)

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/5fhZH97oTFEQZ8UXKzp4j_2c43bfc222eec74e0bd67da47bf43b03a635c91400baaf540e176038380d9f78-image.png)

3. Go back to your Feature Experimentation project settings and paste these values into the corresponding fields: **ODP Public Key (required)** and **ODP Private Key (required)**.
4. Select your region from the **ODP Host (required)** drop-down list.
5. Click **Save**.

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

## Create a Feature Experimentation audience with Data Platform's Real-Time Audiences

:::hint{type="info"}
**Note**
If you enabled unified audiences for your organization, see [Build Feature Experimentation audiences in ODP](docId:84TFVeod2XQfvcgSJ5guS) to create audiences within ODP.
:::

To create a Feature Experimentation [audience](docId\:UDBvr5a8WHNkyOqzPhOr9) using ODP's real-time audiences, complete the following steps:

1. Go to **Audiences > Create New Audience**.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/coH859FoYnoauIXh5viar_aa06206-create-new-audience-flags.png)

:::hint{type="info"}
**Note**
You can also create an audience in your flag's rule.

After creating your audience, you can reuse it in other flags.
:::

2. Enter a **Name**.
3. (Optional) Enter a **Description**.
4. In the audience condition section, expand **Data Platform Real-Time Audiences**.

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

:::hint{type="warning"}
**Important**
If you do not see **Data Platform Real-Time Audiences** as an option, verify that you configured and enabled the integration.
:::

5. Drag and drop  **Custom Segments** or **Pre-built Segments** to the **Audience Conditions** section.
6. Configure the audience as desired (the real-time audiences from ODP display in the **Select an audience** drop-down list).
7. Click **Save Audience**.

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

This creates an audience you can use to target specific users in your [targeted deliveries](docId:_BjMxuGwwlVrhkNcx2kzm), [A/B tests](docId:8pnfCv-sR37goLcxTtCPv), and [multi-armed bandit optimizations](docId\:F5-ZUIoxCu2_XRy26tO-b).

## Integrate Real-Time Audiences in your code

After [Implementing the Real-Time Audiences for Feature Experimentation integration](docId\:IECm8WmxPiCbCBg63cQTl) and [Creating a Feature Experimentation audience with Data Platform's Real-Time Audiences](docId\:IECm8WmxPiCbCBg63cQTl), add your audience to a flag. Then, depending on which SDKs you use, see the following:

- [Real-Time Audiences for Feature Experimentation with client-side SDKs](docId\:iKfXFMXe_eqGd2PbD3j6T).
- [Real-Time Audiences for Feature Experimentation with server-side SDKs](docId\:KjzMgmj-6wFmsgDC1wq5B).

### Datafile updates

After creating an audience using Data Platform Real-Time Audiences and attaching that audience to a flag, Feature Experimentation adds a section in your [datafile](docId:3LmHm4b3kTxKBuoR93KN8) named `integrations`. This lets your application query ODP for audience conditions and send event data to the ODP server.

- Adding an audience that uses Real-Time Audiences to a *running* rule and flag adds that audience to the datafile.
- Adding an audience that uses Real-Time Audiences to a *paused* rule or flag, the audience is not added to the datafile.

## ODP limitations and accuracy

Any [CDP](https://www.optimizely.com/optimization-glossary/customer-data-platform/) has some latency from when it receives data until it can stitch together or create a new profile for the customer. During this latency period, you may receive stale information about your customers if you query your CDP.

ODP has the shortest time to accurate results among competing CDPs. ODP usually takes less than 30 seconds, and for 99.999% of the cases, the process takes less than 90 seconds. Many other CDPs take hours or even days to merge data.

It is important to acknowledge this gap in accuracy and account for potentially inaccurate data. If you need your user segments to be 100% accurate 100% of the time, you should manually create your audiences in Feature Experimentation and target users through custom user attributes. See [Target audiences](docId\:UDBvr5a8WHNkyOqzPhOr9).

An example of when Real-Time Audiences would not be the right use case is when you want to show a purchase confirmation page right after a customer has bought an item. Because it takes at least 30 seconds for the customer to be added to a `has_made_purchase` audience segment, you cannot use that segment to decide whether to show the confirmation page. Instead, you should use a custom user attribute that can be updated through your local code and queried immediately.

The following table shows different times during the ODP customer profile lifecycle and whether the information coming from ODP is accurate:

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/_AfV4-0eT04xcTwP-T-K2_7c4b1ac-feature-experimentation-and-odp-integration.png)

### VUIDs and client-side IDs

ODP uses various identifiers unique to a specific customer to track that customer's data. One of these identifiers is called a `VUID` and is an identifier tied to a specific device.

When you initialize a Feature Experimentation client-side SDK, if a VUID does not exist or the SDK cannot find it, you can enable the SDK to create one. This VUID is stored in persistent storage, re-used, and shared across [SDK instances](docId\:eH-UMm_rOn_GdGDGLV6__) within the device. Additionally, you can enable the SDK to send the default app and user tracking data to ODP on VUID creation.

You can use this VUID with the userID you already provide to Feature Experimentation to merge customer profiles. For information, refer to [Overview of customer identity and resolution](docId\:Ctmpf0RC-3DhpfFdJEXTG) in ODP for information on how to use VUIDs to target audiences or make decisions.

### VUIDs and anonymous targeting

Anonymous audience targeting refers to targeting users who have not provided PII, such as their name or email address, but whose behavior or interactions on a website or app can be tracked and analyzed. With anonymous targeting, you can still deliver personalized content or experiences to these users based on their behavior and preferences without knowing their identity.

In Feature Experimentation, you can conduct anonymous targeting through a VUID, which lets ODP recognize and track the user's data across different sessions or devices without revealing their identity. You can use [ODP's customer analytics tools](docId\:Kx6QX2EH9-AAlTsSP77pp) to analyze the data and identify patterns and trends that can inform your targeting strategy. Using Feature Experimentation, you can run tailored experiments on these users without storing or collecting PII.

Using anonymous targeting using a VUID in ODP and Feature Experimentation, you can create a personalized, data-driven approach to targeting your audience while protecting their privacy. This approach can help you improve engagement, conversions, and overall user satisfaction.
