> For the complete documentation index, see [llms.txt](https://docs.hackle.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hackle.io/ab-test/create-and-configure/ab-targeting.md).

# 타겟팅 설정하기

A/B 테스트 참여 대상을 설정하고 규칙을 구성하는 방법을 알아봅니다.

타겟팅으로 특정 사용자만 A/B 테스트에 참여시킬 수 있습니다. 사용자 속성, A/B 테스트, 기능 플래그, 타겟팅 그룹을 조건으로 사용할 수 있습니다.

{% hint style="info" %}
A/B 테스트 참여자는 먼저 트래픽 할당 대상이 됩니다. 트래픽이 할당되면 테스트 그룹 분배 대상이 될 수 있습니다.

자세한 과정은 [테스트 그룹 분배 과정](/ab-test/group-distribution/ab-variation.md)에서 확인하세요.
{% endhint %}

{% hint style="warning" %}
수동 할당 대상은 타겟팅 대상이 될 수 없습니다. 코호트 타겟팅의 경우 서버 환경 SDK에서는 지원되지 않으며, 클라이언트 SDK 환경에서만 지원됩니다.
{% endhint %}

## 정책

<table data-view="cards"><thead><tr><th>정책</th></tr></thead><tbody><tr><td><strong>설정 가능 시점</strong><br>A/B 테스트 생성부터 종료까지 설정하거나 변경할 수 있습니다.<br><br>적용 가능 상태: <code>준비</code>, <code>진행 중</code>, <code>일시 정지</code>, <code>종료</code></td></tr><tr><td><strong>기본값</strong><br>타겟팅을 설정하지 않으면 <code>모든 사용자</code>가 A/B 테스트 참여 대상입니다.</td></tr><tr><td><strong>환경</strong><br><code>운영</code>, <code>개발</code> 환경에서 설정할 수 있습니다.</td></tr><tr><td><strong>규칙</strong><br>특정 사용자로 타겟을 제한하려면 규칙이 하나 이상 필요합니다. 최대 10개의 규칙을 설정할 수 있습니다.<br><br>규칙은 OR로 연결됩니다. 하나의 규칙만 만족해도 타겟에 포함됩니다.</td></tr><tr><td><strong>조건</strong><br>규칙은 생성 시 조건을 하나 가집니다. 규칙마다 최대 10개의 조건을 추가할 수 있습니다.<br><br>조건은 AND로 연결됩니다. 모든 조건을 만족해야 타겟에 포함됩니다.</td></tr><tr><td><strong>속성</strong><br>속성 조건을 사용하려면 해당 속성을 수집하는 핵클 SDK 연동이 필요합니다.<br><br>A/B 테스트와 기능 플래그도 조건으로 사용할 수 있습니다.</td></tr></tbody></table>

## 규칙 및 조건의 구성

{% hint style="warning" %}
규칙과 조건은 다음 조합으로 구성할 수 있습니다.

1. **`속성명 + 연산자 + 속성값`**
2. **`A/B 테스트 (기능 플래그) + 연산자 + A/B 테스트 그룹 (기능 플래그 상태 값)`**
3. **`타겟팅 그룹 + 연산자 + 사용자 그룹 키`**
   {% endhint %}

사용자의 운영체제를 `osName` 속성으로 수집하는 경우를 예로 들어보겠습니다. Android 사용자를 타겟으로 설정하려면 다음 조합을 만듭니다.

* 속성명: `osName`
* 연산자: **다음 중 하나**
* 속성값: `Android`, `android`

최초로 만든 조합은 첫 번째 규칙이 됩니다. 조합을 같은 규칙에 추가하면 AND로 연결됩니다. 새 규칙으로 추가하면 OR로 연결됩니다.

#### 연산자 선택

연산자는 속성명과 속성값의 관계를 정의합니다. 속성값 타입에 맞는 연산자를 선택하세요.

| 연산자                | 속성값 타입  | 속성값 선택 가능 개수               |
| ------------------ | ------- | -------------------------- |
| 다음 중 하나            | String  | 복수 선택 가능                   |
| 다음 중 하나가 아닌        | String  | 복수 선택 가능                   |
| 다음 중 하나로 시작하는 것    | String  | 복수 선택 가능                   |
| 다음 중 하나로 시작하지 않는 것 | String  | 복수 선택 가능                   |
| 다음 중 하나로 끝나는 것     | String  | 복수 선택 가능                   |
| 다음 중 하나로 끝나지 않는 것  | String  | 복수 선택 가능                   |
| 다음 중 하나를 포함하는 것    | String  | 복수 선택 가능                   |
| 다음 중 하나를 포함하지 않는 것 | String  | 복수 선택 가능                   |
| =                  | Number  | 복수 선택 가능                   |
| ≠                  | Number  | 복수 선택 가능                   |
| ≥                  | Number  | 단일 항목 선택                   |
| ≤                  | Number  | 단일 항목 선택                   |
| >                  | Number  | 단일 항목 선택                   |
| <                  | Number  | 단일 항목 선택                   |
| 참일 경우              | Boolean | 선택 불가 (연산자에 속성값 `참`이 포함됨)  |
| 거짓일 경우             | Boolean | 선택 불가 (연산자에 속성값 `거짓`이 포함됨) |
| version =          | Version | 단일 항목 선택                   |
| version ≠          | Version | 단일 항목 선택                   |
| version >          | Version | 단일 항목 선택                   |
| version ≥          | Version | 단일 항목 선택                   |
| version <          | Version | 단일 항목 선택                   |
| version ≤          | Version | 단일 항목 선택                   |

{% hint style="success" %}
예시: 광역시 거주 사용자

`residence`가 String 타입이라면 **다음 중 하나**를 선택합니다.

속성값으로 `인천광역시`, `대전광역시`, `대구광역시`, `울산광역시`, `부산광역시`, `광주광역시`를 추가하세요.
{% endhint %}

### 대시보드에서 설정하기

{% stepper %}
{% step %}

#### 타겟팅 설정 열기

A/B 테스트 상세 상단에서 \*\*`타겟팅 설정하기`\*\*를 선택합니다. 첫 번째 규칙의 첫 번째 조건이 표시됩니다.
{% endstep %}

{% step %}

#### 첫 번째 조건 입력

속성명, 연산자, 속성값을 순서대로 선택합니다. 연산자에 따라 하나 또는 여러 값을 입력할 수 있습니다.
{% endstep %}

{% step %}

#### 조건 또는 규칙 추가

\*\*`+ AND 조건 추가하기`\*\*로 같은 규칙에 조건을 추가합니다. \*\*`+ 규칙 추가하기`\*\*로 OR 조건의 새 규칙을 추가합니다.
{% endstep %}
{% endstepper %}

![](https://2738466581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHRZjjknm5KdNgPtDsbl%2Fuploads%2Fgit-blob-3344fd25f51da57ef700185da0aff9ea3eb18bdf%2F5cd2295-targeting-ab-create-03_5135a54eda5305b7.png?alt=media)

{% hint style="info" %}
조건을 추가하면 타겟 범위가 좁아집니다. 규칙을 추가하면 타겟 범위가 넓어집니다.
{% endhint %}

### 설정 상태 확인

{% tabs %}
{% tab title="타겟팅 미설정" %}
규칙이 없으면 **모든 사용자**가 A/B 테스트 참여 대상입니다.

**준비 중** 상태에서는 대상 정보, **`타겟팅 설정하기`** 버튼, 규칙 예시를 확인할 수 있습니다.

![](https://2738466581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHRZjjknm5KdNgPtDsbl%2Fuploads%2Fgit-blob-2ceb365faad93fe27c382751bc562d4bd5fa07f5%2F6bfa760-targeting-sdp-01_8963b75c9ba13fb6.png?alt=media)

1. 모든 사용자가 대상임을 표시합니다.
2. `타겟팅 설정하기`로 규칙을 설정합니다.
3. 규칙이 설정되었을 때의 표시 예시입니다. 실제 규칙은 아닙니다.

준비 중이 아닌 상태에서는 모든 사용자 대상 여부만 표시됩니다.

![](https://2738466581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHRZjjknm5KdNgPtDsbl%2Fuploads%2Fgit-blob-f28397c9efec57fe8f5f1dbd2ab9ad66add54259%2Fd4b1ba0-_2023-04-12__11.09.01_2395451a90455bfa.png?alt=media)

모든 사용자가 대상임을 표시합니다.
{% endtab %}

{% tab title="타겟팅 설정됨" %}
규칙이 하나 이상이면 설정된 규칙 수가 표시됩니다. 기본 화면에서는 규칙이 접혀 있습니다.

![](https://2738466581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHRZjjknm5KdNgPtDsbl%2Fuploads%2Fgit-blob-6fc0ceaf69458608f8fff39704f9dde26f90853f%2F42c9276-targeting-sdp-03_61c0772d46853086.png?alt=media)

1. 설정된 규칙 수를 표시합니다.
2. 규칙이 접힌 상태임을 나타냅니다.
3. `타겟팅 설정하기`로 규칙을 변경합니다.
4. 첫 번째 규칙의 첫 번째 조건을 미리 봅니다.

펼치기 아이콘을 선택하면 모든 규칙을 확인할 수 있습니다.

![](https://2738466581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLHRZjjknm5KdNgPtDsbl%2Fuploads%2Fgit-blob-37aee42eca7a259a1d64baa61abf0a36adcca88d%2F669bdcb-targeting-sdp-04_47b8ef1639a5ac25.png?alt=media)
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hackle.io/ab-test/create-and-configure/ab-targeting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
