A/B Test Experience with Alhena AI Answers

This page explains how to configure Alhena AI responses based on whether a user is part of a Variant or Control group.

For example:

  • Variant Group: Display a greeting message to the user.

  • Control Group: Ask the user for their email address.

To achieve this, you need to:

  1. Determine the current user's group assignment (test or control).

  2. Adjust the answer guidelines accordingly.

We support two variables

ab_control_group for Control Group

ab_variant_group for Variant / Test Group

Adding user in "ab_control_group"

if user is in your control group then pass in user metadata like this

// Some code
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<!-- Loading of chat SDK -->
<script>
    document.gleenConfig = {
        company: 'gleen',
        apiBaseUrl: 'https://app.alhena.ai',
        userMetadata: {
            "ab_control_group" : "1" // you can pass any fixed value
        },
    };
</script>
<script src="https://app.alhena.ai/sdk/gleenWidget.js"></script>

</body>
</html>

Adding user in "ab_variant_group"

If user is in your variant group "ab_variant_group"

// Some code
// Some code
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<!-- Loading of chat SDK -->
<script>
    document.gleenConfig = {
        company: 'gleen',
        apiBaseUrl: 'https://app.alhena.ai',
        userMetadata: {
            "ab_variant_group" : "1" // you can pass any fixed value
        },
    };
</script>
<script src="https://app.alhena.ai/sdk/gleenWidget.js"></script>

</body>
</html>

Please note that - don't put both control and variant group for the same user

Answering Guideline Rules

If user metadata information contains "ab_variant_group" then Reply with greetings in beginning.
    
If user metadata information contains "ab_control_group" then Ask for the user’s email address at the beginning.    

Last updated