|
| 1 | +--- |
| 2 | +title: 'Optimizely Feature Experimentation (Actions) Destination' |
| 3 | +id: 641d5acea88fa531b9068608 |
| 4 | +hide-personas-partial: true |
| 5 | +hide-boilerplate: false |
| 6 | +hide-dossier: true |
| 7 | +hidden: true |
| 8 | +--- |
| 9 | + |
| 10 | +[Optimizely Feature Experimentation](https://www.optimizely.com/products/experiment/feature-experimentation/){:target="_blank"} is a feature flagging and experimentation platform for websites, mobile apps, chatbots, APIs, smart devices and anything else with a network connection. |
| 11 | + |
| 12 | +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. |
| 13 | + |
| 14 | +Segment’s Optimizely Feature Experimentation (Actions) destination supports tracking of conversion events. |
| 15 | +Segment supports one action (event): trackEvent. [TrackEvent](https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/track-event-javascript-node){:target="_blank"} sends user conversion events for active experiments. Segment sends data using Optimizely's [Event API](https://docs.developers.optimizely.com/experimentation-data/reference/post_events){:target="_blank"}. |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +Optimizely works differently than other Segment destinations: it requires that customers implement some Optimizely functionality native to make sure your experiment logic runs correctly. |
| 20 | + |
| 21 | +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](https://docs.developers.optimizely.com/experimentation-data/reference/post_events){:target="_blank"}. |
| 22 | +Segment's API does not include methods that correspond to decision-based methods. |
| 23 | + |
| 24 | +This requires that customers include a native Optimizely implementation before their Segment implementation on pages or in mobile apps where Optimizely experiments run. |
| 25 | + |
| 26 | +## Getting started |
| 27 | + |
| 28 | +Before connecting to the Optimizely Feature Experimentation destination, you must have a [Optimizely Feature Experimentation](https://www.optimizely.com/products/experiment/feature-experimentation/){:target="_blank"} account, Account ID and Datafile URL. |
| 29 | + |
| 30 | +To connect the Optimizely Feature Experimentation destination: |
| 31 | + |
| 32 | +1. From the Segment web app, click **Catalog**, then click **Destinations**. |
| 33 | +2. Search for **Optimizely Feature Experimentation** in the Destinations Catalog, and select the destination. |
| 34 | +3. Click **Configure Optimizely Feature Experimentation (Actions)** in the top-right corner of the screen. |
| 35 | +4. Select the source that will send data to Optimizely Feature Experimentation and follow the steps to name your destination. |
| 36 | +5. On the **Settings** tab, input your `datafile` URL and your Account Id. Toggle “Enable Destination” on and click **Save Changes**. |
| 37 | +6. Navigate to the **Mappings** tab, click **New Mapping**, and select **Track Event**. |
| 38 | +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. |
| 39 | + * **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. |
| 40 | + * **Note:** The current user should activate a running experiment with the associated metric before sending track events to Segment. |
| 41 | + |
| 42 | +### Track |
| 43 | + |
| 44 | +Upon invocation of a Segment `track` event, Segment maps the event to an Optimizely `track` event: |
| 45 | +* If the Segment event name matches exactly the name of an active experiment `metric` set up in the Optimizely dashboard; |
| 46 | +* If the experiment `metric` is associated with a running experiment; |
| 47 | +* If the current user has been assigned a `userId` using Segment's `identify` method (for example, `analytics.identify('123')`); |
| 48 | +* If the current user is activated in a running experiment with the associated `metric`. |
| 49 | + |
| 50 | +Segment also handles the following mapping: |
| 51 | +* Segment maps `track` events to Optimizely `eventName`. |
| 52 | +* Segment maps `track` event, `properties`, to Optimizely `eventTags`. |
| 53 | +* Segment maps `track` event, `context.traits`, to Optimizely `attributes`. |
| 54 | + |
| 55 | +`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`. |
| 56 | + |
| 57 | +## GDPR Support |
| 58 | +Segment supports deleting/suppressing users in Optimizely Feature Experimentation (Actions) using the [Segment app](/docs/privacy/user-deletion-and-suppression/). Before deleting/suppressing a user, create a [Personal Access Token](https://developers.optimizely.com/x/authentication/personal-token/) in Optimizely and provide it as the value of the Personal Access Token setting. |
| 59 | + |
| 60 | +{% include components/actions-fields.html settings="true"%} |
0 commit comments