Optimizely Full Stack: Use Pendo Segments in Feature Flags and Experimentation

Last updated:


The best product teams can iterate on features quickly based on customer feedback, however it can be difficult to prove the value of new features and measure adoption without the right tools in place. This is why Pendo and Optimizely teamed up to allow our mutual customers to connect Pendo data like product usage to target experiments and features in Optimizely Full Stack. After a winning variation has been determined, the variation can be rolled out as a feature flag through Optimizely and Pendo can continue to track feature engagement and provide insights.

Ingredients You Will Need

  • Optimizely Full Stack or Rollouts account
  • Pendo with API access
  • Product and Engineering teams

How it works

Step 1: Determine the feature or experiment in Optimizely that should be controlled by a Pendo Segment.

Step 2: In Pendo, create a Segment with the behavioral characteristics of the users you want the feature to be rolled out to, and create a Visitor Report that reports on users in that segment.

Step 3: In Optimizely, create an Attribute that represents the Visitor Report in Pendo. We will use this later as our Audience condition for our experiment or feature flag and check whether it evaluates to True or False. 

As an example for naming conventions in Optimizely, if your Pendo Visitor Report is a query for `all Visitors where Feature X was Used Within Last 30 Days` the attribute in Optimizely could be `USED_FEATURE_X_LAST_30_DAYS`. The nomenclature is up to what makes sense for your team.

Step 4: Have your Optimizely developer use the Pendo Segment membership when evaluating the feature flag or experiment for a user. Here is a node example:


In this example, the `userFromReport` method takes in a User Id, and is represented by the variable `userid`. The userid and Pendo Visitor ID must be the same value. Keep in mind that Optimizely does not accept PII, such as email addresses, so both the Pendo Visitor ID and User ID used by Optimizely in the decision must be anonymized.

The pendo method `requestList` makes an API request to fetch the Pendo Visitor Report based on the Pendo Visitor Report ID. This ID can be found when viewing the Visitor Report in Pendo:


An attributes object is enriched with a property called ‘PENDO_AUDIENCE’ and its value is set to true or false, representing if that user is in the Pendo segment or not.


The Optimizely `activate` method is called and evaluates what variation this user should see in based on our experiment key, represented by the variable `experiment_key`, and sends an impression event to Optimizely if the user qualifies for the experiment.

Lastly, we recommend caching the Pendo specific attributes in a global user profile or object to minimize http requests.

For an end-to-end example, see our Github repo here.

Step 5: Analyze your Optimizely results to ensure data is coming in and continue to monitor your test and see how your variations are impacting product usage.


  • Personalize features for specific segments based on app usage
  • Drill into how certain audiences are affected by onboarding experiences
  • Personalize app experience for users
Was this article helpful?
0 out of 1 found this helpful