Products sorted alphabetically
1. Awesome Shoes ($49.99)
2. Best Shirt ($69.99)
3. Cool Socks ($9.99)
How it works:
This example displays two variants of product pages to the users. Both pages use different sorting orders to display the list of products. It uses Optimizely feature flag in the Vercel Middleware to determine the sort order and to redirect users to correct pages. A unique visitor id is being generated, stored in the cookie and reused so that the decisions stick for the same browser session.
Out of the box, Optimizely's Full Stack SDKs require a user-provided identifier to be passed in at runtime to drive experiment and feature flag decisions. This example generates a unique id, stores it in a cookie and reuses it to make the decisions sticky. Another common approach would be to use an existing unique identifier available within your application.
For more information on how Optimizely Full Stack SDKs bucket visitors, see here.