# Set Metrics

You can register all the metrics you want to measure in an A/B Test.

## About metrics

A metric is the means to measure the performance of an A/B Test — it is the measurement criterion used to determine whether the Treatment (Group B, C, D, ...) achieves better results than the Control (Group A).

For example, suppose you are improving the UX of the order form page. The purpose of improving the order form page is to increase the percentage of users who click the payment button and complete an order compared to before.

In this case, how should you set the metrics for the A/B Test?

Since more users need to click the payment button on the order form page, you can set 'payment button click rate' (= number of users who clicked the payment button out of users who participated in the A/B Test) as a metric.

And to check how many users completed an order, you can set 'purchase conversion rate' (= number of users who completed an order out of users who participated in the A/B Test) as a metric.

{% hint style="info" %}
You can add metrics while the A/B Test is running.

Even if you missed registering a metric before starting the A/B Test, you can still add it.
{% endhint %}

## Select metrics

Click the **`Set Metrics`** button in the upper right of the **`Data Analytics`** tab on the A/B Test detail page.

![](/files/aAOFfE25Z2K7fJP5WIz6)

When you click the Set Metrics button, a dialog like the image below appears.

From the left area of the dialog, you can select a previously created metric, or click 'Create metric manually' to create a new one. Selected metrics are displayed in the right area of the dialog.

Note that you can select and add multiple metrics at once.

The additional information displayed for each metric is as follows:

* The Key value of the event used to calculate the metric (e.g., purchase, view\_item)
* The type of the metric (e.g., Event Metric, Time Metric)

Metrics labeled 'Sample' are example metrics provided to aid understanding.

![](/files/nyCtco3E6wyIerVHE72R)

Added metrics can be divided into several types according to their purpose. You can change the type by reordering using the icon to the left of the metric name.

1. Success metric: The key metric for determining whether the A/B Test was a success.
2. Guardrail metric: A metric that must always be monitored across all A/B Tests to ensure no negative impact on the overall service.
3. Other: A metric that doesn't fall under either of the above two types but for which you want to confirm causality through the A/B Test.

Once you have selected all metrics, click the **`Save`** button to complete the configuration.\
After the metric configuration is complete, you can view the configured metrics in the **`Metrics`** tab on the A/B Test detail page.

![When 2 or more metrics are selected](/files/lDibDBuBtSi5uksfv771)

## Create a metric manually

Clicking the **`Create metric manually`** button displays a dialog like the one below.

Metrics are divided into **`Event Metric`** and **`Time Metric`**. Event metrics are for measuring whether a user behavior occurred or its frequency — such as purchase conversion rate, average number of clicks, or average order amount. Time metrics are used to measure a specific duration — such as time spent on a page, or the time from the order form to order completion.

The configuration method for each is described in order below.

![](/files/DhV9qq8pqvRgGKbu0zbK)

### Create an event metric

Clicking **`Event Metric`** shows the screen below.

You can see the metric name, the metric settings to define the measurement method, and the additional settings at the bottom. In particular, you can see that the metric settings area lets you configure the numerator and denominator of the metric separately.

![Create metric manually popup](/files/mevsGtlWoSCsYJv5VIlk)

#### Step 1. Enter metric name and description

Enter the name and description of the metric. Entering a description helps other team members understand what the metric is.

#### Step 2. Configure data settings

Configure which users to target and what data to analyze.\
Setting 'which users to target' is called the **denominator configuration**, and setting 'what data to analyze' is called the **numerator configuration**.

1. Numerator configuration\
   An **`event`** is required for configuration.\
   You can either select an existing event or create a new one.\
   If you need help creating an event, refer to the [Create Event](/en/event-management/create-event.md) document.
2. Denominator configuration\
   You can choose from 2 options:

* All exposures basis: Refers to all users exposed to the A/B Test. If A/B Test exposure occurs at the point of entering a specific page, set the denominator to All exposures basis, not the page entry event.
* Specific event basis: Refers to users who, among those exposed to the A/B Test, **additionally triggered the selected event after being exposed**. For example, if you set the event to 'login', only users who triggered the 'login' event among all test participants will be included in the denominator. Note: a paid plan (Pro plan or higher) is required to use the specific event basis.

{% hint style="info" %}
Why are events necessary?

For example, a company is considering changing the color of the purchase button. To verify if the change is effective, they create an A/B Test and set two metrics: 'purchase button click count' and 'purchase conversion rate'.

* To calculate 'purchase button click count', they need to collect the number of times users click the purchase button. So they create an event called 'purchase button click' and count the number of times that event occurred.
* To calculate 'purchase conversion rate', they need to know how many times user purchases were completed. So they create a 'purchase completed' event and collect the number of occurrences.
  {% endhint %}

{% hint style="info" %}
How does entering an event connect to the actual code?

1. When you select an event auto-collected via SDK integration\
   In this case, since you are selecting an event that already exists in the code, data calculation is possible automatically.
2. When you select a manually entered event\
   In this case, since you are selecting an event that does not exist in the code, you need to instrument that event at the desired location in the code before starting the test for data calculation to work smoothly.
   {% endhint %}

#### Step 2-1. All exposures basis

All users exposed to the A/B Test are set as the denominator of the metric. Configure the denominator's calculation type and numerator.\
For the numerator configuration, you can select a **measurement event**, **calculation type**, and **filter**.\
Results are provided considering the calculation type and filter conditions of the selected event relative to users exposed to the A/B Test.

![All exposures basis (users exposed to A/B Test) - select event and calculation type](/files/kg2X0XcBtXWnaxiKkLPJ)

**Filters** help you configure more precise metrics by using the attribute information of users or events.

For example, in an A/B Test running on a specific category page such as fashion, you may want to measure 'fashion product purchase conversion rate'. In this situation, you can use filters to set the desired metric.

In the first box of the filter, select the desired user or [event property](/en/event-management/properties.md), and in the second box, select multiple desired values from the selected property.\
Using And conditions, you can set up to 5 filter conditions.

{% hint style="warning" %}
If you create a metric with a filter selected, you will not be able to use the Data Segment Analytics feature.
{% endhint %}

When selecting **All exposures basis** as the denominator, you can configure 5 types of metrics:

<table><thead><tr><th width="109.94140625">Numerator</th><th width="109.8671875">Denominator</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Users</td><td>Users</td><td>Calculates the ratio of users who triggered the selected event out of all users exposed to the A/B Test.</td><td>Purchase conversion rate, banner click rate, search conversion rate</td></tr><tr><td>Count</td><td>Users</td><td>Calculates the average number of times the selected event was triggered by users exposed to the A/B Test.</td><td>Average button clicks per user, average purchases per user</td></tr><tr><td>Value</td><td>Users</td><td>Calculates the average value generated from the selected event by users exposed to the A/B Test.</td><td>Average purchase amount per user</td></tr><tr><td>Value</td><td>Count</td><td>Calculates the average value generated from the selected event relative to the number of times users were exposed to the A/B Test.</td><td>Average page loading speed (Latency)</td></tr><tr><td>Count</td><td>Count</td><td>Calculates the average number of times the selected event occurred relative to the number of A/B Test exposures. * Note: The number of A/B Test exposures must be greater than the number of event occurrences set as the numerator for statistical analysis to be possible.</td><td>Average clicks per A/B Test exposure</td></tr></tbody></table>

#### Step 2-2. Specific event basis

{% hint style="info" %}
Only cases where the user triggered the numerator event after triggering the denominator event are included in the calculation.

When selecting 'Specific event basis', only cases where the user was exposed to the A/B Test, then triggered the denominator event, and then triggered the numerator event are reflected in the metric calculation.
{% endhint %}

When selecting specific event basis, you must configure both the denominator and numerator of the metric.

Filter configuration is also available if needed.\
In this case, you can select the event corresponding to the denominator of the metric, and the denominator will be set to the users who triggered the specific event after being exposed to the A/B Test, or the number of event occurrences.

![Manual configuration - event occurrence and basis setting](/files/O0MLeDXKh0AQYZUNfMb0)

For the numerator configuration, select both the event and calculation type, the same as when selecting All exposures basis for the denominator.\
However, for the denominator configuration, the availability of event and calculation type selection varies depending on which calculation type was selected in the numerator configuration.

Also, only cases where the user triggered the event selected in the denominator after being exposed to the experiment, and then triggered the numerator event, are included in the metric calculation.

![When specific event basis is selected as the denominator - calculated considering the before/after relationship of denominator/numerator event occurrences](/files/LFSlOO1fFD48hl5XzH2D)

The types of metrics available when selecting **Specific event basis** are as follows:

<table><thead><tr><th width="109.75">Numerator</th><th width="109.55078125">Denominator</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Users</td><td>Users</td><td>Calculates the ratio of users who triggered the numerator event after triggering the denominator event.</td><td>Purchase conversion rate from add-to-cart, button click rate from landing page entry</td></tr><tr><td>Value</td><td>Users</td><td>Calculates the average value generated from the numerator event after users triggered the denominator event.</td><td>Average purchase amount per buyer</td></tr><tr><td>Value</td><td>Count</td><td>Calculates the average value generated from the numerator event after the denominator event occurred, relative to the number of times the denominator event was triggered.</td><td>Average order value (AOV)</td></tr><tr><td>Count</td><td>Count</td><td>Calculates the number of times the numerator event occurred relative to the number of times the denominator event occurred. * Note: The number of occurrences of the denominator event must be greater than the number of occurrences of the numerator event for statistical analysis to be possible.</td><td>Search result click conversion rate from search attempts</td></tr></tbody></table>

#### Step 3. Success criteria

Select success criteria to distinguish the characteristics of the metric. For example, purchase amount is better when it increases, while the number of returns is better when it decreases.

![Enter metric description and select metric success criteria](/files/TwwDbjAMLYVOT3COr9HN)

* **`Increase compared to Control (Group A)`**: When a **higher** value is better
  * Example metrics: purchase conversion rate, number of searches, number of subscribers, etc.
* **`Decrease compared to Control (Group A)`**: When a **lower** value is better
  * Example metrics: number of payment cancellations, page loading time, etc.

#### Step 4. Create

Click the **`Create`** button in the lower right to complete creating the metric manually.\
The created metric appears in the list as the **`Existing`** type, and you can see that it is automatically selected.

### Create a time metric

#### Data settings

You need to define the interval for which you want to measure time, and this is configured in the numerator and denominator areas.

1. Numerator configuration\
   Set the start point of the interval to measure in 'Start Event', and the end point in 'End Event'.

* Example: Measure the time spent on the membership sign-up process. The start event could be 'entering the page where sign-up information is entered', and the end event could be 'sign-up completed'.

Below the start and end events, there is an area to set 'calculation conditions'. Only cases where the user reached from the start event to the end event within the time set in the calculation conditions are included in the calculation.

* Example: Measure the time from app open to order completion. In this case, you can exclude cases where the order was not completed within 1 hour of the app opening from the calculation.

2. Denominator configuration\
   Set the calculation type for the time metric. You can select either 'Users' or 'Conversion count', and selecting each item allows you to measure the following:

* Users: Average time spent per user (e.g., service session duration)
* Conversion count: Average time taken for a conversion (reaching from start event to end event) (e.g., time from entering the order form to order completion)

The method for entering the metric name and additional settings is the same as for event metrics.

![](/files/pxUPoqr80XHt2RiuVtLa)

### Delete a metric

You can delete metrics that no longer need to be tracked in the A/B Test.

Click the **`Set Metrics`** button. You can see the currently selected metrics on the right side of the dialog.

![](/files/MeBg1MCXuf2HayBtzhZA)

Click the X icon on the right side of each metric to delete it. After deletion, click the **`Save`** button to apply the changes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hackle.io/en/ab-test/create-and-configure/set-metrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
