For the complete documentation index, see llms.txt. This page is also available as Markdown.

Variation Distribution Result

When running an A/B Test, you need to distribute users to test groups and write the logic for each test group. User distribution can be done through the Hackle SDK.

Variation

A Variation refers to the current version (Control) and the improved version(s) (Treatment) that are the subjects of the test. There can be 1 or more Treatment groups.

You can configure them in the Dashboard. For how to manage test groups, refer to the A/B Test Settings document.

variation

By passing the Experiment Key to the variation() method, you can distribute users and receive the result. Then implement the logic for each test group.

In the example code below, Experiment Key 42 is being passed, and there are two test groups: A and B.

// 실험 키가 42인 A/B 테스트에서 사용자에게 노출할 테스트 그룹을 결정합니다.
// 결정하지 못하는 상황인 경우 테스트 그룹 A를 반환합니다.
Variation variation = hackleApp.variation(42);

// 할당받은 그룹에 대한 로직
if (variation == Variation.A) {
  // 그룹 A 로직
} else if (variation == Variation.B) {
  // 그룹 B 로직
}
// 실험 키가 42인 A/B 테스트에서 사용자에게 노출할 테스트 그룹을 결정합니다.
// 결정하지 못하는 상황인 경우 테스트 그룹 A를 반환합니다.
val variation = hackleApp.variation(42)

// 할당받은 그룹에 대한 로직
if (variation == Variation.A) {
  // 그룹 A 로직
} else if (variation == Variation.B) {
  // 그룹 B 로직
}

variationDetail

The variationDetail() method works the same as the variation() method and additionally provides the reason why the user was distributed to a specific group. This method is useful for checking whether distribution is working correctly. You need to pass the Experiment Key as a parameter. In the example code below, Experiment Key 42 is being passed.

The distribution decision reason is received in the format SDK_NOT_READY, for example. For more details, refer to the table below.

Reason
Description
Distribution Result

SDK_NOT_READY

The SDK is not ready. Or an initialization was attempted with an invalid SDK Key.

Default group (A)

EXPERIMENT_NOT_FOUND

The A/B Test for the passed Experiment Key could not be found. The Experiment Key may be incorrect, or the experiment may be in Archived status.

Default group (A)

EXPERIMENT_DRAFT

The A/B Test is in Draft status.

Default group (A)

EXPERIMENT_PAUSED

The A/B Test is in Paused status.

Default group (A)

EXPERIMENT_COMPLETED

The A/B Test has been completed.

Winner group selected at completion

OVERRIDDEN

The user has been assigned to a specific group by Override.

The overridden group

NOT_IN_EXPERIMENT_TARGET

The user is not a target of the A/B Test.

Default group (A)

TRAFFIC_NOT_ALLOCATED

The A/B Test is running but the user has not been allocated to the test.

Default group (A)

TRAFFIC_ALLOCATED

The user has been allocated to the A/B Test.

The allocated group

VARIATION_DROPPED

The originally allocated group has been dropped from the test.

Default group (A)

EXCEPTION

An unknown error occurred.

Default group (A)

IDENTIFIER_NOT_FOUND

The distribution criterion identifier was not sent.

Default group (A)

NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT

The experiment is included in a Mutually Exclusive Settings but the user was not allocated to that Mutually Exclusive Group.

Default group (A)

Last updated