Jinja Random for AB Test

September 13, 2020
{% set test_type = ['a', 'b']|random %}

{% if test_type == 'a' %}
This is A
{% else %}
This is B
{% endif %}
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.