|
1 | 1 | ---
|
2 | 2 | title: Optimizely Web
|
| 3 | +mark: https://cdn.filepicker.io/api/file/8nygQ8DuSbWK01VIjZE5 |
| 4 | +excerpt: Segment makes it easy to send your data to [Optimizely Web](#) (and lots of other destinations). Once you've tracked your data through our open source [libraries](#) we'll translate and route your data to Optimizely Web in the format they understand. [Learn more](#) about how to use Optimizely Web with Segment. |
3 | 5 | ---
|
4 | 6 | ## Getting Started
|
5 | 7 |
|
@@ -37,18 +39,18 @@ Segment provides specific implementation details for each Optimizely product in
|
37 | 39 |
|
38 | 40 | ### Getting Started
|
39 | 41 |
|
40 |
| -1. In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*). |
41 |
| -2. Go to your project’s home page in your Optimizely dashboard, then navigate to Settings -> Implementation and select the snippet version you’d like to include on your Web page. |
42 |
| -3. In your Optimizely dashboard, select "Use Both Optimizely X and Optimizely Classic" under "Snippet Configuration." |
43 |
| -4. In your Optimizely dashboard, copy the snippet provided at the bottom of the page. The snippet looks something like this: |
| 42 | +{% include components/list-steps.html number="1" content='In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*)' %} |
| 43 | +{% include components/list-steps.html number="2" content="Go to your project’s home page in your Optimizely dashboard, then navigate to Settings -> Implementation and select the snippet version you’d like to include on your Web page." %} |
| 44 | +{% include components/list-steps.html number="3" content='In your Optimizely dashboard, select "Use Both Optimizely X and Optimizely Classic" under "Snippet Configuration."' %} |
| 45 | +{% include components/list-steps.html number="4" content="In your Optimizely dashboard, copy the snippet provided at the bottom of the page. The snippet looks something like this:" %} |
44 | 46 |
|
45 |
| - ```javascript |
| 47 | + ```html |
46 | 48 | <script src="//cdn.optimizely.com/js/#########.js"></script>
|
47 | 49 | ```
|
48 | 50 |
|
49 |
| -5. Include the snippet immediately after the opening `<head>` tag on every page where you’d like to include Optimizely’s JavaScript. |
50 |
| -6. Now, paste your Segment snippet below the Optimizely snippet on every page where you’d like to include Segment’s JavaScript. |
51 |
| -7. Finally, remember to define any `metrics` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`. |
| 51 | +{% include components/list-steps.html number="5" content="Include the snippet immediately after the opening `<head>` tag on every page where you’d like to include Optimizely’s JavaScript." %} |
| 52 | +{% include components/list-steps.html number="6" content="Now, paste your Segment snippet below the Optimizely snippet on every page where you’d like to include Segment’s JavaScript." %} |
| 53 | +{% include components/list-steps.html number="7" content="Finally, remember to define any `metrics` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`." %} |
52 | 54 |
|
53 | 55 | ### Track
|
54 | 56 |
|
@@ -161,24 +163,26 @@ If you run multiple experiments during a user session, since `traits` are cached
|
161 | 163 |
|
162 | 164 | ## Optimizely Classic Android
|
163 | 165 |
|
164 |
| -**NOTE: Optimizely Mobile Classic has been officially deprecated as of September 30, 2018. You won't be able to start new experiments in Classic.** |
| 166 | +{% capture noteAndroid %} |
| 167 | + Optimizely Mobile Classic has been officially deprecated as of September 30, 2018. You won't be able to start new experiments in Classic. |
| 168 | +{% endcapture %} |
| 169 | +{% include components/note.html content=noteAndroid %} |
165 | 170 |
|
166 | 171 | For Segment’s Optimizely Full Stack Android destination, see Segment's [Optimizely Full Stack](./../optimizely-full-stack/index.md) documentation.
|
167 | 172 |
|
168 | 173 | ### Getting Started
|
169 |
| -1. In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*). |
170 |
| -2. Go to your project’s home page in your Optimizely dashboard and retrieve your `projectId` - you’ll need this to instantiate Optimizely. |
171 |
| -3. Include the desired version of the Optimizely Classic Android SDK as a dependency in your Android app. |
172 |
| -4. Instantiate Optimizely - you’ll use this instance to invoke methods from Optimizely’s decision API such as `activate` and `isFeatureEnabled`. |
173 |
| -5. Instantiate Segment’s global Analytics object with an Optimizely factory registered: |
| 174 | +{% include components/list-steps.html number="1" content='In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*).' %} |
| 175 | +{% include components/list-steps.html number="2" content="Go to your project’s home page in your Optimizely dashboard and retrieve your `projectId` - you’ll need this to instantiate Optimizely." %} |
| 176 | +{% include components/list-steps.html number="3" content="Include the desired version of the Optimizely Classic Android SDK as a dependency in your Android app." %} |
| 177 | +{% include components/list-steps.html number="4" content="Instantiate Optimizely - you’ll use this instance to invoke methods from Optimizely’s decision API such as `activate` and `isFeatureEnabled`." %} |
| 178 | +{% include components/list-steps.html number="5" content="Instantiate Segment’s global Analytics object with an Optimizely factory registered:" %} |
174 | 179 |
|
175 | 180 | ```java
|
176 | 181 | analytics.use(OptimizelyIntegration.createFactory(context, /* your Optimizely projectId */));
|
177 | 182 | ```
|
178 | 183 |
|
179 |
| - Since Optimizely needs to be initialized as early as possible, you need to supply your Optimizely `projectId` when you initialize the factory registered with the analytics client. Once registered, Segment maps `track` and `identify` events to Optimizely methods. |
180 |
| - |
181 |
| -7. Finally, remember to define any `metrics` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`. |
| 184 | +{% include components/list-steps.html number="6" content="Since Optimizely needs to be initialized as early as possible, you need to supply your Optimizely `projectId` when you initialize the factory registered with the analytics client. Once registered, Segment maps `track` and `identify` events to Optimizely methods." %} |
| 185 | +{% include components/list-steps.html number="7" content="Finally, remember to define any `metrics` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`." %} |
182 | 186 |
|
183 | 187 | ### Track
|
184 | 188 |
|
@@ -208,24 +212,28 @@ Upon an Optimizely experiment activation, Segment’s Optimizely Classic<>Androi
|
208 | 212 |
|
209 | 213 | ## Optimizely Classic iOS
|
210 | 214 |
|
211 |
| -**NOTE: Optimizely Mobile Classic has been officially deprecated as of September 30, 2018. You won't be able to start new experiments in Classic.** |
| 215 | +{% capture noteIOS %} |
| 216 | + Optimizely Mobile Classic has been officially deprecated as of September 30, 2018. You won't be able to start new experiments in Classic. |
| 217 | +{% endcapture %} |
| 218 | +{% include components/note.html content=noteIOS %} |
212 | 219 |
|
213 | 220 | For Segment’s Optimizely Full Stack iOS destination, see Segment's [Optimizely Full Stack documentation](./../optimizelyx/index.md).
|
214 | 221 |
|
215 | 222 | ### Getting Started
|
216 |
| -1. In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*). |
217 |
| -2. Go to your project’s home page in your Optimizely dashboard and retrieve your `projectId` - you’ll need this to instantiate Optimizely. |
218 |
| -3. Include the desired version of the Optimizely 1.x iOS SDK as a dependency in your iOS app. |
219 |
| -4. Instantiate Optimizely - you’ll use this instance to invoke methods from Optimizely’s decision API such as `activate` and `isFeatureEnabled`. |
220 |
| -5. Instantiate Segment’s global Analytics object with an Optimizely factory registered: |
| 223 | +{% include components/list-steps.html number="1" content='In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*).' %} |
| 224 | +{% include components/list-steps.html number="2" content="Go to your project’s home page in your Optimizely dashboard and retrieve your `projectId` - you’ll need this to instantiate Optimizely." %} |
| 225 | +{% include components/list-steps.html number="3" content="Include the desired version of the Optimizely 1.x iOS SDK as a dependency in your iOS app." %} |
| 226 | +{% include components/list-steps.html number="4" content="Instantiate Optimizely - you’ll use this instance to invoke methods from Optimizely’s decision API such as `activate` and `isFeatureEnabled`." %} |
| 227 | +{% include components/list-steps.html number="5" content="Instantiate Segment’s global Analytics object with an Optimizely factory registered:" %} |
221 | 228 |
|
222 | 229 | ```objc
|
223 | 230 | [config use:[SEGOptimizelyIntegrationFactory instanceWithToken: /* your Optimizely project id /* launchOptions:launchOptions]];
|
224 | 231 | ```
|
225 | 232 |
|
226 | 233 | Since Optimizely needs to be initialized as early as possible, you need to supply the Optimizely `projectId` when you initialize the factory registered with the analytics client. Once registered, Segment maps `track` and `identify` to Optimizely.
|
227 | 234 |
|
228 |
| -6. Finally, remember to define any `metrics` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`. |
| 235 | +{% include components/list-steps.html number="6" content="Finally, remember to define any `metrics` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`." %} |
| 236 | +
|
229 | 237 |
|
230 | 238 | ### Track
|
231 | 239 |
|
@@ -259,13 +267,13 @@ Upon an Optimizely experiment activation, Segment’s Optimizely Classic<>iOS SD
|
259 | 267 |
|
260 | 268 | ### Getting Started
|
261 | 269 |
|
262 |
| -1. In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*). |
263 |
| -2. Go to your project’s home page in your Optimizely dashboard, then navigate to Settings -> Implementation and select the snippet version you’d like to include on your Web page. |
264 |
| -3. In your Optimizely dashboard, select "Use only Optimizely X" under "Snippet Configuration." |
265 |
| -4. In your Optimizely dashboard, copy the snippet provided at the bottom of the page. |
266 |
| -5. Include the snippet immediately after the opening `<head>` tag on every page where you’d like to include Optimizely’s JavaScript. |
267 |
| -6. Now, paste your Segment snippet below the Optimizely snippet on every page where you’d like to include Segment’s JavaScript. |
268 |
| -7. Finally, remember to define any `metrics` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`. |
| 270 | +{% include components/list-steps.html number="1" content='In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*).' %} |
| 271 | +{% include components/list-steps.html number="2" content="Go to your project’s home page in your Optimizely dashboard, then navigate to Settings -> Implementation and select the snippet version you’d like to include on your Web page." %} |
| 272 | +{% include components/list-steps.html number="3" content='In your Optimizely dashboard, select "Use only Optimizely X" under "Snippet Configuration."' %} |
| 273 | +{% include components/list-steps.html number="4" content="In your Optimizely dashboard, copy the snippet provided at the bottom of the page." %} |
| 274 | +{% include components/list-steps.html number="5" content="Include the snippet immediately after the opening `<head>` tag on every page where you’d like to include Optimizely’s JavaScript." %} |
| 275 | +{% include components/list-steps.html number="6" content="Now, paste your Segment snippet below the Optimizely snippet on every page where you’d like to include Segment’s JavaScript." %} |
| 276 | +{% include components/list-steps.html number="7" content="Finally, remember to define any `metrics` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`." %} |
269 | 277 |
|
270 | 278 | ### Track
|
271 | 279 |
|
@@ -359,12 +367,12 @@ If you’re sending your experiments to Google Analytics in the form of `track`
|
359 | 367 |
|
360 | 368 | ### Getting Started
|
361 | 369 |
|
362 |
| -1. In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*). |
363 |
| -2. Require Optimizely’s `@optimizely/optimizely-sdk` on your site and create an `optimizelyClientInstance`. |
364 |
| -3. The instance must be named `optmizelyClientInstance`. |
365 |
| -4. Attach the `optimizelyClientInstance` to the `window` so Segment recognizes it. |
366 |
| -5. Now, paste your Segment snippet below the Optimizely implementation on every page where you’d like to include Segment’s JavaScript. Or, if you’ve implemented Optimizely in a separate file, ensure Segment loads only after Optimizely has been initialized. |
367 |
| -6. Finally, remember to define any `metrics` and `attributes` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`. |
| 370 | +{% include components/list-steps.html number="1" content='In your Segment source dashboard, enable the "Optimizely Web" destination (*not the "Optimizely Full Stack" destination*).' %} |
| 371 | +{% include components/list-steps.html number="2" content="Require Optimizely’s `@optimizely/optimizely-sdk` on your site and create an `optimizelyClientInstance`." %} |
| 372 | +{% include components/list-steps.html number="3" content="The instance must be named `optmizelyClientInstance`." %} |
| 373 | +{% include components/list-steps.html number="4" content="Attach the `optimizelyClientInstance` to the `window` so Segment recognizes it." %} |
| 374 | +{% include components/list-steps.html number="5" content="Now, paste your Segment snippet below the Optimizely implementation on every page where you’d like to include Segment’s JavaScript. Or, if you’ve implemented Optimizely in a separate file, ensure Segment loads only after Optimizely has been initialized." %} |
| 375 | +{% include components/list-steps.html number="46" content="Finally, remember to define any `metrics` and `attributes` in your Optimizely dashboard, and to associate `metrics` with the appropriate Optimizely Experiments. Segment maps `track` event names to Optimizely `eventName` - the `eventName` corresponds to an experiment `metric`." %} |
368 | 376 |
|
369 | 377 | ### Track
|
370 | 378 |
|
|
0 commit comments