> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adrop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Targeting Option Rules Detailed Guide

> When creating targeting options, you set conditions on properties or contexts. This guide explains available operators by data type and how to combine filters.

***

## Value Format by Data Type

Formats used when passing property values from the SDK.

| Type        | Format                 | Example                                    |
| ----------- | ---------------------- | ------------------------------------------ |
| **String**  | Text                   | `"seoul"`, `"premium"`, `"user@email.com"` |
| **Number**  | Integer or decimal     | `0`, `123`, `-456`, `1234.56`              |
| **Boolean** | true / false           | `true`, `false`                            |
| **Date**    | ISO 8601 (recommended) | `2024-01-18`, `2024-01-20T08:20:00`        |

<Note>
  ISO 8601 format (`YYYY-MM-DD`) is recommended for dates. `YYYYMMDD` and timestamps (ms) are also supported.
</Note>

***

## String Operators

Operators available for string type properties.

| Operator             | Description                             | Example                       |
| -------------------- | --------------------------------------- | ----------------------------- |
| **is**               | Include users that match exactly        | region is "Seoul"             |
| **is not**           | Exclude users that match exactly        | region is not "Seoul"         |
| **contains**         | Include users that contain the value    | email contains "gmail"        |
| **does not contain** | Exclude users that contain the value    | email does not contain "test" |
| **starts with**      | Include users that start with the value | username starts with "admin"  |
| **ends with**        | Include users that end with the value   | email ends with ".com"        |

<Warning>
  String operators are case-sensitive. "Seoul" and "seoul" are treated as different values.
</Warning>

<Note>
  The <strong>is</strong> operator allows selecting multiple values. Example: region is "Seoul", "Busan", "Jeju"
</Note>

***

## Number Operators

Operators available for number type properties.

| Operator                   | Description                                       | Example                               |
| -------------------------- | ------------------------------------------------- | ------------------------------------- |
| **is**                     | Include users that match exactly                  | age is 25, 30, 35                     |
| **is not**                 | Exclude users that match exactly                  | age is not 0                          |
| **equals**                 | Include users equal to value                      | trade\_count equals 10                |
| **not equals**             | Include users not equal to value                  | trade\_count not equals 0             |
| **greater than**           | Include users greater than value (>)              | trade\_count greater than 5           |
| **greater than or equals** | Include users greater than or equal to value (>=) | trade\_count greater than or equals 5 |
| **less than**              | Include users less than value (\<)                | trade\_count less than 20             |
| **less than or equals**    | Include users less than or equal to value (\<=)   | trade\_count less than or equals 20   |
| **between**                | Include users between two values                  | age between 20, 29                    |
| **not between**            | Exclude users between two values                  | age not between 20, 29                |

<Note>
  The <strong>is</strong> operator allows selecting multiple values. <strong>between / not between</strong> require two values.
</Note>

***

## Boolean Operators

Operators available for boolean (true/false) type properties.

| Operator     | Description                    | Example              |
| ------------ | ------------------------------ | -------------------- |
| **is True**  | Include users with true value  | is\_premium is True  |
| **is False** | Include users with false value | is\_premium is False |

***

## Date Operators

Operators available for date type properties.

| Operator            | Description                        | Example                                  |
| ------------------- | ---------------------------------- | ---------------------------------------- |
| **last**            | Include users within past period   | last\_login last 7 days                  |
| **before the last** | Include users before past period   | last\_login before the last 30 days      |
| **next**            | Include users within next period   | subscription\_end next 7 days            |
| **after the next**  | Include users after next period    | subscription\_end after the next 30 days |
| **before**          | Include users before specific date | created\_at before 2024-01-01            |
| **after**           | Include users after specific date  | created\_at after 2024-01-01             |

***

## Combining Targeting Option Rules

You can set multiple conditions for a single targeting option.

### Add Condition (AND)

Clicking **Add Condition** connects with AND logic. Only users satisfying all conditions are included.

**Example: Seoul Power Seller**

* region is "seoul" **AND**
* trade\_count greater than or equals 20

→ Users in Seoul region with 20+ trades

### Add Condition Group (OR)

Clicking **Add Condition Group** connects with OR logic. Users satisfying any group are included.

**Example: Capital Region Users**

* (region is "seoul") **OR**
* (region is "gyeonggi")

→ Users in Seoul or Gyeonggi region

### Complex Conditions

Use AND and OR together to create complex conditions.

**Example: Capital Region Power Sellers**

* (region is "seoul" AND trade\_count greater than or equals 20) **OR**
* (region is "gyeonggi" AND trade\_count greater than or equals 20)

→ Seoul power sellers or Gyeonggi power sellers

***

## Context Targeting Operators

In context targeting, the following operators are available for context IDs.

| Operator     | Description                   | Example                                |
| ------------ | ----------------------------- | -------------------------------------- |
| **is**       | Matches context ID exactly    | context is "phone", "laptop", "tablet" |
| **is not**   | Does not match context ID     | context is not "adult"                 |
| **contains** | Contains string in context ID | context contains "sports"              |

<Note>
  When selecting multiple context IDs with the <strong>is</strong> operator, ads display if any of those IDs match.
</Note>

***

## Next Steps

<Card title="Booking Campaigns" icon="calendar-check" href="/campaign">
  Learn how advertisers select targeting to book campaigns
</Card>

***

## FAQ

<AccordionGroup>
  <Accordion title="What's most important when setting targeting option conditions?">
    Entering exactly as passed from the SDK is critical. Especially for strings, which are case-sensitive—"Seoul" and "seoul" are treated as different values. Confirm actual passed values with your development team.
  </Accordion>

  <Accordion title="When are date conditions useful?">
    Useful for targeting user states that change over time. For example, "active users who logged in within the last 7 days", "users with subscription expiring within 30 days", "long-term members who joined over 1 year ago".
  </Accordion>

  <Accordion title="How do I distinguish when to use AND vs OR conditions?">
    Use AND (Add Condition) when all conditions must be satisfied simultaneously. Use OR (Add Condition Group) when any one of multiple conditions can be satisfied. For example, "Seoul power seller" is region=Seoul AND trade\_count≥20, while "Capital region users" is region=Seoul OR region=Gyeonggi.
  </Accordion>
</AccordionGroup>
