Optimizely Feature Experimentation (Actions) Destination

Optimizely Feature Experimentation is a feature flagging and experimentation platform for websites, mobile apps, chatbots, APIs, smart devices and anything else with a network connection.

With the Optimizely SDK you can deploy code behind feature flags, experiment with A/B tests and use percentage deliveries to roll out or roll back flags immediately.

Segment’s Optimizely Feature Experimentation (Actions) destination supports tracking of conversion events. Segment supports one action (event): trackEvent. TrackEvent sends user conversion events for active experiments. Segment sends data using Optimizely’s Event API.

Prerequisites

Optimizely works differently than other Segment destinations: it requires that customers implement some Optimizely functionality native to make sure your experiment logic runs correctly.

Segment maps track events to Optimizely’s track method. You must implement all Optimizely decision-based methods, such as activate and isFeatureEnabled. Segment sends data using Optimizely’s Event API. Segment’s API does not include methods that correspond to decision-based methods.

This requires that customers include a native Optimizely implementation before their Segment implementation on pages or in mobile apps where Optimizely experiments run.

Getting started

Before connecting to the Optimizely Feature Experimentation destination, you must have a Optimizely Feature Experimentation account, Account ID and Datafile URL.

To connect the Optimizely Feature Experimentation destination:

  1. From the Segment web app, click Catalog, then click Destinations.
  2. Search for Optimizely Feature Experimentation in the Destinations Catalog, and select the destination.
  3. Click Configure Optimizely Feature Experimentation (Actions) in the top-right corner of the screen.
  4. Select the source that will send data to Optimizely Feature Experimentation and follow the steps to name your destination.
  5. On the Settings tab, input your datafile URL and your Account Id. Toggle “Enable Destination” on and click Save Changes.
  6. Navigate to the Mappings tab, click New Mapping, and select Track Event.
  7. Under Select mappings, select the event key from the dropdown or input the event manually as the “event” and select the other mappings. Click Save and toggle to enable the mapping.
    • Note: The conversion event will only be sent if the configured event key exactly matches the name of an active experiment metric set up in the Optimizely dashboard.
    • Note: The current user should activate a running experiment with the associated metric before sending track events to Segment.

Track

Upon invocation of a Segment track event, Segment maps the event to an Optimizely track event:

  • If the Segment event name matches exactly the name of an active experiment metric set up in the Optimizely dashboard;
  • If the experiment metric is associated with a running experiment;
  • If the current user has been assigned a userId using Segment’s identify method (for example, analytics.identify('123'));
  • If the current user is activated in a running experiment with the associated metric.

Segment also handles the following mapping:

  • Segment maps track events to Optimizely eventName.
  • Segment maps track event, properties, to Optimizely eventTags.
  • Segment maps track event, context.traits, to Optimizely attributes.

revenue values should be passed as a Segment property. The value should be an integer and represent the value in cents, so, for example, $1 should be represented by 100.

GDPR Support

Segment supports deleting/suppressing users in Optimizely Feature Experimentation (Actions) using the Segment app. Before deleting/suppressing a user, create a Personal Access Token in Optimizely and provide it as the value of the Personal Access Token setting.

Destination Settings

Setting Description
Personal Access Token

The personal access token will be used to submit a GDPR delete request to Optimizely. To generate a personal access token, navigate to Profile->API Access and generate a new token.

Optimizely Account Id Required.

In order to use Optimizely Feature Experimentation (Actions) via server side, you must enter your Account ID from your Optimizely account. You can find this ID by visiting https://app.optimizely.com/v2/accountsettings/account/plan

Datafile URL Required.

The datafile is a JSON representation of the current state of flags and experiments for an environment in your Full Stack project. It should look something like https://cdn.optimizely.com/json/9218021209.json

Available Actions

Build your own Mappings. Combine supported triggers with the following Optimizely Feature Experimentation-supported actions:

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

Track Event

Track Conversion Events

Track Event is a Cloud action. The default Trigger is: type = "track"

Click to show / hide fields

Field Description
Event Key* Type: STRING

The key of the event to be tracked. This key must match the event key provided when the event was created in the Optimizely app.

User ID* Type: STRING

The ID of the user associated with the event being tracked. Important: This ID must match the user ID provided to Activate or Is Feature Enabled.

Event Attributes Type: OBJECT

A map of custom key-value string pairs specifying attributes for the user that are used for results segmentation.

Revenue Type: INTEGER

An integer value that is used to track the revenue metric for your experiments, aggregated across all conversion events.

Value Type: NUMBER

A floating point value that is used to track a custom value for your experiments. Use this to pass the value for numeric metrics.

Event Tags Type: OBJECT

A map of key-value pairs specifying tag names and their corresponding tag values for this particular event occurrence. Values can be strings, numbers, or booleans. These can be used to track numeric metrics, allowing you to track actions beyond conversions, for example: revenue, load time, or total value. See details on reserved tag keys.

Timestamp* Type: DATETIME

Timestamp of the event

Unique ID* Type: STRING

Unique ID for the event

Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

Setting Description
Personal Access Token password. The personal access token will be used to submit a GDPR delete request to Optimizely. To generate a personal access token, navigate to Profile->API Access and generate a new token.
Optimizely Account Id
(required)
string. In order to use Optimizely Feature Experimentation (Actions) via server side, you must enter your Account ID from your Optimizely account. You can find this ID by visiting https://app.optimizely.com/v2/accountsettings/account/plan
Datafile URL
(required)
string. The datafile is a JSON representation of the current state of flags and experiments for an environment in your Full Stack project. It should look something like https://cdn.optimizely.com/json/9218021209.json

This page was last modified: 30 Aug 2023



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account