Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Optimizely Feature Experimentation (Actions) Destination


Optimizely Feature Experimentation(link takes you to an external page) 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(link takes you to an external page) sends user conversion events for active experiments. Segment sends data using Optimizely's Event API(link takes you to an external page).


Prerequisites

prerequisites page anchor

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(link takes you to an external page). 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.


Before connecting to the Optimizely Feature Experimentation destination, you must have a Optimizely Feature Experimentation(link takes you to an external page) 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

track page anchor

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.


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


Property nameTypeRequiredDescription
Personal Access Tokenpassword

Optional

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 Idstring
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 URLstring
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


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

(information)

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

Track Conversion Events

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

Property nameTypeRequiredDescription
Event KeySTRING
required

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 IDSTRING
required

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 AttributesOBJECT

Optional

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


RevenueINTEGER

Optional

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


ValueNUMBER

Optional

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 TagsOBJECT

Optional

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.


TimestampDATETIME
required

Timestamp of the event


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

Property nameTypeRequiredDescription
Personal Access Tokenpassword

Optional

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 Idstring
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 URLstring
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