Last active
December 19, 2025 00:00
-
-
Save openjck/7085c782eda89c68f8f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {# Randomly determine if the new heading should be shown #} | |
| {% set show_new_heading = random_boolean() %} | |
| {% if show_new_heading %} | |
| <h1>The Best Documentation Around</h1> | |
| {% endif %} | |
| <script> | |
| window['optimizely'] = window['optimizely'] || []; | |
| {% if show_new_heading %} | |
| // Bucket visitor into the "New Heading" Optimizely variation for reporting | |
| // | |
| // NOTE: The bucketVisitor API was changed after this Gist was | |
| // published. Please see this blog post for more information: | |
| // | |
| // https://blog.johnkarahalis.com/using-the-optimizely-api-to-avoid-flashes-of-unstyled-content-in-a-b-tests | |
| window['optimizely'].push(['bucketVisitor', 555555, 123456]); | |
| {% else %} | |
| // Bucket visitor into the baseline Optimizely variation for reporting | |
| // | |
| // NOTE: The bucketVisitor API was changed after this Gist was | |
| // published. Please see this blog post for more information: | |
| // | |
| // https://blog.johnkarahalis.com/using-the-optimizely-api-to-avoid-flashes-of-unstyled-content-in-a-b-tests | |
| window['optimizely'].push(['bucketVisitor', 555555, 654321]); | |
| {% endif %} | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment