> For the complete documentation index, see [llms.txt](https://userflux.gitbook.io/userflux-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://userflux.gitbook.io/userflux-docs/feature-guides/audience-hub/segments-and-computed-properties.md).

# Segments & Computed Properties

The User Management area gives you two powerhouse tools for crafting richer audiences and profile data:

| Feature             | What it does                                                                                | Typical uses                                                                        |
| ------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| Segments            | Rule‑based “buckets” of users. Evaluated continuously and available everywhere in UserFlux. | Targeting emails/workflows, filtering Insights, defining activation cohorts.        |
| Computed Properties | Extra profile fields calculated from other properties or events in real‑time.               | Totals (page views), formulas (LTV), dynamic text, device lists, gender estimation. |

Both live side‑by‑side in the right‑hand panels of User Management.

***

## 1 · Segments

### **What is a Segment?**

A saved set of users that match one or more rules (e.g. *Plan = Premium AND Email Verified = true*). As user profiles change—or new events come in—membership is updated in real-time.

### **Creating & Editing**

1. Click Add in the Segments panel.
2. Give it a Name and Description (helpful in large workspaces).
3. Build rules with the visual rule‑builder:
   * Choose a Profile Property (or Computed Property).
   * Pick an operator (Equals, Contains, >, etc.).
   * Enter a value.
   * Click Add rule or Add condition group for AND/OR logic.
4. Click Calculate to preview how many users match.
5. Save → the segment appears immediately under Segments and is usable in Insights, Funnels, User Composition, Workflows, and API filters.

> Tip: A segment can reference other segments—perfect for building funnels like “Onboarded Users ∩ Super Users”.

***

## 2 · Computed Properties

Computed Properties enrich each profile with data that isn’t sent explicitly from your app. They’re recalculated automatically whenever underlying data changes and are queryable just like normal properties.

### **Types you can create**

| Type                 | What it does                                                    | Example                                     |
| -------------------- | --------------------------------------------------------------- | ------------------------------------------- |
| Formula Value        | Math or boolean expression on existing numeric/text fields.     | totalSpent / sessions → avgOrderValue       |
| Dynamic Text         | Concatenate or transform text properties.                       | firstName + ' ' + lastName → fullName       |
| Event Value          | Aggregate a user’s events (count, max, sum, array, first/last). | Count of page\_view events → totalPageViews |
| Estimate User Gender | AI guess based on name/email/etc.                               | Adds gender property (“male”, “female”).    |

### **Building a Computed Property**

1. Click Add in the Computed Properties panel → choose a type.
2. Enter Name & Description.
3. Configure inputs:
   * For Formula or Dynamic Text, select profile fields to reference.
   * For Event Value, choose event name, time window, aggregation (COUNT, SUM, FIRST, etc.).
4. Save to start live calculation.
5. (Optional) Backfill Computed Properties – runs the calculation across historical profiles/events so every existing user has a value.

Computed values update in real-time after any relevant profile update or new event, keeping segments and Insights in sync.

***

## 3 · Using Them in the Platform

| Where              | How you use them                                                                                      |
| ------------------ | ----------------------------------------------------------------------------------------------------- |
| Insights & Funnels | Filter or break down by Segment / Computed Property exactly like any profile field.                   |
| Workflows          | Trigger emails or journeys when a user enters a segment, or use computed fields in message templates. |
| Reports            | Add variable controls bound to segments (“Country = {{segment}}”) for interactive dashboards.         |

***

## 4 · Best Practices

1. Name clearly – use kebab or snake case (requires-onboarding, totalPageViews); avoid spaces.
2. Keep segments atomic – small, reusable rules (e.g. “has‑purchased”) compose better than huge nested conditions.
3. Leverage Computed Props in Segments – e.g. segment “Power Users” where totalPageViews > 1000.
4. Backfill during off‑peak – large backfills can be heavy; kick them off after business hours.
5. Document – add descriptions so teammates know what each item means.

***

## 5 · Quick Start Checklist

1. Open User Management → Segments panel → Add.
2. Build rule → Save → verify member count.
3. Add a Computed Property (e.g. totalPurchases).
4. Backfill if needed.
5. Use the new segment / property in an Insight or Workflow.<br>

Now you can slice, dice, and automate on truly meaningful user data—all without touching your tracking code.


---

# 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://userflux.gitbook.io/userflux-docs/feature-guides/audience-hub/segments-and-computed-properties.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.
