A/B Test Guidelines

Configure different AI responses for A/B testing based on user group assignment.

This example shows how to configure Alhena AI to respond differently based on whether a user is part of a Variant or Control group, enabling you to run A/B tests on AI behavior.

What You'll Learn

  • Pass A/B test group assignments via user metadata

  • Configure guidelines with Trigger/Action format

  • Differentiate AI responses based on group membership

Use Case

A/B testing your AI agent allows you to:

  • Test different greeting styles or conversation openers

  • Compare conversion rates between response strategies

  • Measure the impact of different AI behaviors on user engagement

  • Validate changes before rolling out to all users

For example:

  • Variant Group: Display a greeting message to the user

  • Control Group: Ask the user for their email address

Prerequisites

  • Alhena SDK installed on your website

  • An A/B testing system that assigns users to groups

Supported Variables

Alhena supports two metadata variables for A/B testing:

Variable
Purpose

ab_control_group

Identifies Control Group users

ab_variant_group

Identifies Variant/Test Group users

Code Example

Adding user to Control Group

If the user is in your control group, pass ab_control_group in user metadata:

Adding user to Variant Group

If the user is in your variant group, pass ab_variant_group:

Note: Don't pass both control and variant group for the same user.

Configuring Guidelines

Navigate to AI Settings > Guidelines and create guidelines using the Trigger/Action format to respond differently based on user group.

Variant Group Guideline

Trigger: Metadata in User Information contains "ab_variant_group"

Action:

Control Group Guideline

Trigger: Metadata in User Information contains "ab_control_group"

Action:

How It Works

  1. Group assignment: Your A/B testing system assigns users to either control or variant group

  2. Metadata passed: The SDK sends the group assignment via userMetadata to the AI.

  3. Guideline triggers: Alhena detects the metadata and activates the matching guideline

  4. Differentiated response: The AI follows the action defined for that group

Customization

Dynamic group assignment

Integrate with your A/B testing platform:

Multiple A/B tests

You can run multiple tests by using descriptive metadata values:

Then create guidelines with more specific triggers:

Trigger: Metadata in User Information "ab_variant_group" equals "greeting_test_v2"

Last updated