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

# Segments: Targeting the Right Users for Each Test

> Learn how to build audience filters in Fleack using built-in platform attributes and profile data drawn from your own user endpoints.

A **segment** in Fleack is an eligibility filter that determines which users qualify to participate in a test. When a user makes a request that would otherwise be rewritten by a running test, Fleack checks whether that user matches the test's segment. If they do, they get assigned to a variant. If they don't, the response passes through unchanged. Segments let you run targeted experiments — rolling out a price change to high-LTV users only, or testing a feature exclusively on iOS — without writing any custom logic.

## Attribute sources

Segments are built from two categories of attributes:

**Built-in attributes** are extracted automatically from every request Fleack proxies:

* `platform` — one of `ios`, `android`, `unity`, or `web`, derived from the User-Agent header
* `language` — the app's locale, from the `Accept-Language` header
* `country` — derived from the request's IP address

**Profile attributes** are extracted over time from your `user-data` endpoints — the ones Fleack classifies as returning per-user responses. As Fleack observes these responses, it builds up a profile for each user. Common profile attributes include:

* `arpu` — average revenue per user
* `level` — the user's current progression level
* `days_since_install` — days elapsed since first seen
* `ltv_tier` — a lifetime value tier (e.g. whale, mid, low)

Profile attributes are auto-discovered: any scalar field that appears consistently in your `user-data` responses becomes available as a segment attribute automatically. You don't need to configure a schema.

## Operators

Segment rules support the following comparison operators:

| Operator  | Meaning                             |
| --------- | ----------------------------------- |
| `eq`      | Equals                              |
| `neq`     | Not equals                          |
| `in`      | Value is in a list                  |
| `nin`     | Value is not in a list              |
| `gt`      | Greater than                        |
| `gte`     | Greater than or equal to            |
| `lt`      | Less than                           |
| `lte`     | Less than or equal to               |
| `between` | Value is within a range (inclusive) |

A user matches a segment only if **every rule** in that segment evaluates to true. Rules are combined with AND logic.

## Example

To target experienced iOS users who have been using the app for at least a week:

```
platform eq ios
AND days_since_install gte 7
```

Only users whose platform is `ios` AND whose `days_since_install` is 7 or more will be assigned to a variant. All other users see the unmodified backend response.

## The "All users" default

When you create a test without selecting a segment, it defaults to **All users** — no filter is applied and every exposure counts, regardless of platform, language, or profile. This is the right starting point for most first tests.

<Tip>
  Start broad with "All users" to gather data quickly, then use segments on follow-up tests to verify whether the effect holds for specific sub-populations, or to roll out a winner to a cautious group first.
</Tip>

<Note>
  Profile attributes become available in the segment builder only after Fleack has observed the relevant `user-data` endpoint enough times to establish them. If an attribute you expect isn't showing up, send more traffic through the proxy from users who have that field in their responses.
</Note>
