Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev guideRecipesAPI Reference
Dev guideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Real-Time Segments for Feature Experimentation

Real-Time Segments for Feature Experimentation lets you expand your audience targeting capability in Optimizely Feature Experimentation by leveraging Optimizely Data Platform's CDP Audience Sync

Prerequisites

To use Real-Time segments for Feature Experimentation, you must have the following:

  • an Optimizely Feature Experimentation account.
  • an Optimizely Data Platform (ODP) account.
  • real-time segments set up in ODP (pre-built or custom).

Before implementing Real-Time Segments for Feature Experimentation, you must decide on what customer data platform (CDP) you want to use. See the Integrate with other CDPs section.

Before implementing Real-Time Segments for Feature Experimentation, you must understand how ODP handles user data and how real-time segments work. See ODP's end-user documentation and developer documentation to learn more.

Introduction

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

By using ODP's real-time segments through CDP Audience Sync, you can create detailed audiences to target specific users in your flag rules without increasing the size of the datafile.

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 for more.

Integration architecture

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

ODP to Feature Experimentation integration architecture

Click to enlarge image


Implement the Real-Time Segments for Feature Experimentation integration

Only the segments in Customers > Real-Time Segments page in ODP are available for use with Real-Time Segments for Feature Experimentation.

real time segments

Integrate with other CDPs

🚧

Important

If you use ODP as your CDP, do not complete this section. Skip to the Enable Real-Time Segments for Feature Experimentation in Optimizely Feature Experimentation section.

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

  1. Configure the CDP integration in ODP:
  2. Follow steps 1-8 in the following section.

Enable Real-Time Segments for Feature Experimentation in Optimizely Feature Experimentation

  1. In the Optimizely application, select the Optimizely Feature Experimentation project for which you want to enable the integration.

  2. Go to Settings > Integrations > Real-Time Segments.

  3. Toggle the integration status to On.

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

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

  6. Go back to your Optimizely Feature Experimentation project settings and paste these values into the corresponding fields (ODP Public Key (required) and ODP Private Key (required)).

  7. Select your region from the ODP Host (required) drop-down list.

  8. Click Save.


Create an Optimizely Feature Experimentation audience using ODP's real-time segments

To create a Feature Experimentation audience using ODP's real-time segments:

  1. Go to Audiences > Create New Audience.

    Create New Audience

    📘

    Note

    You can create and add an audience from the Audiences page or directly in your flag's rule. After creating your audience, you can reuse it in other flags.

  2. Fill in the Name (required) and Description (optional) fields.

  3. In the audience condition section, expand Real-Time Segments.

🚧

Important

If you do not see Real-Time Segments as an option, verify that the integration was set up and enabled. See Enable Real-Time Segments for Feature Experimentation in Optimizely Feature Experimentation.

  1. Drag and drop Custom Segments or Pre-built Segments to the Audience Conditions section.

  2. Configure the audience as desired (the real-time segments from ODP display in the Select an audience drop-down list).

  3. Click Save Audience.

This creates an audience you can use to target specific users in your targeted deliveries, A/B tests, and multi-armed bandit optimizations.

Integrate Real-Time Segments for Feature Experimentation in your code

Datafile updates

  • After creating an audience using Real-Time Segments for Feature Experimentation and attaching that audience to a flag, the Optimizely Feature Experimentation SDK adds a new section in your datafile 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 Segments for Feature Experimentation to a running rule and flag adds that audience to the datafile.
    • If the rule containing the Real-Time Segments audience or the flag containing it is paused, it is not added to the datafile.

Configure your SDK

Depending on which SDKs you use see:

ODP limitations and accuracy

Any CDP 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 Optimizely Feature Experimentation and target users through custom user attributes. See Target audiences.

An example of when Real-Time Segments for Feature Experimentation 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 will take 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:

PMNE = Profile may not exist

N/A = Profile not available as identify call has not happened yet

(Click image to enlarge)

PMNE = Profile may not exist

N/A = Profile not available as identify call has not happened yet

(Click image to enlarge)

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 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 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 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.