This repository contains code and documentation for the Opticon "Peanut Butter and Jelly: Feature Experimentation & Optimizely Data Platform"
This Demo contains several components
-
Mosey Fashion - An Optimizely Foundation demo fashion retail website
-
optimizely/opticon-fs-odp-demo - (This repository) contains JavaScript code implementing Optimizely Feature Experimentation and Optimizely Data Platform on Mosey Fashion
-
Opticon 22 ODP Demo (FS) - An Optimizely Feature Experimentation project containing the feature flags that control the behavior of the promotional "hero" and "banner" features on Mosey Fashion
-
Opticon 22 ODP Demo (Web) - An Optimizely Web Experimentation containing an ODP audience shared with Opticon 22 ODP Demo (FS)
-
Optimizely Experimentation Demo - An Optimizely Data Platform instance
In the /demo directory, use the following to build the demo javascript payload
npm install
npm run buildDeploy by committing the contents of /dist to the main branch of this repository and pushing to Github. Github will use a webhook to tell the Mosey Fashion backend to download the contents of this repository and serve them statically.
You can trigger a "deploy" manually with
./bin/deploy.shOpen the following tabs:
-
2022-10-04 Opticon Full Stack + ODP Demo (Google Slides)
-
Mosey Fashion (Foundation)
- Use the chrome inspector to clear application storage
-
Opticon 22 ODP Demo (FS) (Feature Experimentation)
-
The Production promo_hero flag Targeted Delivery rule must Deliver the
20 Percent Offvariation theEveryoneaudience -
The Production promo_hero flag must be turned
OffinProduction -
The promo_banner Targeted Delivery rule must deliver the
20 Percent Offvariation to theHas Seen Offer (ODP)audience -
The Production promo_hero flag must be turned
OffinProduction
-
-
Optimizely Experimentation Demo (Data Platform)
-
Opticon 22 ODP Demo (Web) (Web Experimentation)
-
optimizely/opticon-fs-odp-demo (Github)
- It's fine to use Visual Studio with a local clone of this repository instead
-
[Slides 1-7] Title and Introduction - Present slides 1-6 directly
-
[Slide 8 - 11] Feature Flags - Do not present these slides, instead:
-
Show Mosey Fashion
-
Show the promo_hero flag and and walk through the concept of variables, and show the specific variable values in the
20 Percent Offvariation -
Turn the
promo_heroflagOninProduction(notDevelopment!) -
Show the
decideAndRenderPromo()function in flags.js and explain how the flag implementation works, starting with the call togetOptimizelyUserContextand stopping after the call torenderHero -
Show Mosey Fashion and hard refresh. You should see the "promo hero" offering 20% off
-
-
[Slides 12-17] Feature Targeting Do not present these slides, instead:
-
Show the
promo_heroflag and target the Targeted Delivery rule to theHas Purchased (Local)audience -
Show the
Has Purchased (Local)audience and explain how thehas_purchased_localattribute is used to construct it. -
Show the
instrumentAddToCart()function in [instrument.js](https://github.com/optimizely/opticon-fs-odp-demo/blob/main/demo/src/instrument.js) and explain how thehas_purchased_local` attribute is set in localstorage -
Show the
getOptimizelyUserContext()function infullstack.jsand explain how attributes are retrieved from local storage to create theUserContextobject -
Show Mosey Fashion and hard refresh. You should NOT see the "promo hero" offer anymore
-
Navigate to a Product Detail Page and add the item to your cart
-
Navigate back to the Home Page. You should now see the "promo hero" offer again (because you just "purchased")
-
-
[Slides 18-25] Feature Targeting with ODP Present slides 19 and 20 directly, then
-
Show ODP Real Time Segments and find the
Has Purchased At Least OnceRTS and explain what ODP attributes are, and how theHas Purchasedattribute is used to build this audience -
Show the the [
Has Purchased (ODP)audience] and explain how the ODP Audience Targeting works -
Show the
promo_heroflag and remove theHas Purchased (Local)audience, and replace it with theHas Purchased (ODP)audience -
Show the
instrumentAddToCart()function in [instrument.js](https://github.com/optimizely/opticon-fs-odp-demo/blob/main/demo/src/instrument.js) again and explain thewindow.odpClient.customercall for setting thehas_purchased` ODP attribute -
Show the
getOptimizelyUserContext()again and explain theuserCtx.fetchQualifiedSegments()call -
Show Mosey Fashion and hard refresh. You should still see the "promo hero" offer. Open up the chrome inspector, look at local storage, and copy the
fs_user_idvalue. -
Open up an incognito window and load Mosey Fashion. You should not see the promo offer. Now, add a url parameter,
?userid=fs_user_id_XXXX, pasting in the value you copied from local storage. NOW you should see the promo offer. You can ham it up by incrementing the number and demonstrating that the offer goes away, and then decrementing it and bringing the offer back -
Show the
Has Purchased (ODP)Optimizely Web audience while the speaker talks about audience portability
-
-
[Slides 26-28] Hybrid Local+ODP Feature Targeting Present slides 26 and 27 directly, then
- Show the promo_hero flag and add the
Has Purchased (Local)audience to the rule so that both theLocalandODPaudiences are being targeted
- Show the promo_hero flag and add the
-
[Slides 29-31] Flag Observability don't present these slides, instead
-
Show the Full Stack Flag Decisions Report
-
Show the addNotificationListeners function in
fs2odp.jsand explain how it works
-
-
[Slides 32-37] Flag Dependencies do not present these slides directly
-
Show the
Has Seen Offer At Least OnceRTS in ODP -
Show the
decideAndRenderHeroPromofunction inflags.jsand explain thewindow.odpClient.customercall whenhero_promois enabled -
Turn the
promo_bannerflagOnand explain the targeting -
Show Mosey Fashion and navigate to a product detail page, demonstrating that you in fact now see the banner. If you like you can change the user ID again and show how it goes away.
-
-
[Slides 38-39] Present the slides directly