> For the complete documentation index, see [llms.txt](https://docs.userlane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.userlane.com/administration/audiences/build-an-audience-from-attribute-rules.md).

# Build an audience from attribute rules

How to create an audience in the Userlane portal, choose conditions based on attributes or behavior, combine them with AND/OR logic, and check who matches before saving.

An audience[^1] groups users by conditions you define, so that content reaches the right people and analytics reflect the right group. This article covers creating an audience from the **Targeting** page: picking conditions based on attributes or behavior, combining them, checking who matches, and saving. For what an audience is and how it fits into content targeting and analytics, see [Audiences](/administration/audiences.md).

{% hint style="warning" %}
**Before you start.** Attribute-based conditions need at least one attribute. Attributes arrive through single sign-on (SSO), a connector, manual upload, or the application programming interface (API). Behavioral conditions[^2] need no setup, because Userlane collects that data automatically. See [Attributes](/administration/attributes.md) and [Attribute sources](/administration/attributes/attribute-sources.md) for background.
{% endhint %}

<div data-with-frame="true"><figure><img src="https://259567114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF6bxg8i3T6U4vZ3k7PHi%2Fuploads%2FFvhVpiyAk0BRLPNOK9y9%2Ftargeting.png?alt=media&#x26;token=152ae0ad-ddf2-4042-a9f1-a5f331572af6" alt="The Targeting page in the Userlane portal, listing existing audiences and page rules"><figcaption><p>The Targeting page lists your audiences and page rules.</p></figcaption></figure></div>

## Create an audience

{% stepper %}
{% step %}

#### Open the Targeting page

In the portal sidebar, select **Targeting** under **Assistance**. The page lists your existing audiences and page rules[^3].

Select **Add Audience**.
{% endstep %}

{% step %}

#### Name the audience and pick a data type

On the **Create a new Audience** page, enter a name in the **Audience Name** field. Choose something descriptive enough that other team members can tell what it targets without opening it, for example "Warehouse staff, first 30 days" rather than "Audience 1."

Select the **Choose Data** dropdown in the condition row. The data types available include attributes (company and application level), behavioral data (**First Time Active**, **Last Time Active**, **Guide Interaction**), **Customer User ID**, and [Tags](/intelligence/tags.md).

Which type you pick depends on what you want to match. Attributes answer who someone is (role, department, location). Behavioral data answers what they have done (when they first appeared, whether they finished a guide). **Customer User ID** targets individual users by their identifier in the underlying application.
{% endstep %}

{% step %}

#### Pick a connection type

After you select a data type, a second dropdown appears with the connection types available for that type. The connection type controls how Userlane matches the value you enter against what it knows about each user.

For attributes and **Customer User ID**, the connection types are:

* **Equals:** the value matches exactly.
* **Does not equal:** the value is anything other than the input.
* **Starts with:** the value begins with the input.
* **Contains:** the input appears anywhere in the value.
* **Does not contain:** the input does not appear anywhere in the value.
* **Is one of:** the value matches any item in a comma-separated list.
* **Is not one of:** the value does not match any item in a comma-separated list.
* **Is empty:** the attribute has no value for the user.
* **Is not empty:** the attribute has any value at all.

Behavioral data has its own connection types. See [Condition types for behavioral data](#condition-types-for-behavioral-data).
{% endstep %}

{% step %}

#### Enter the value

Type the value to match. Values are matched case-sensitively by default, which means "Manager," "manager," and "MANAGER" count as three different values. The audience builder has a control to turn case sensitivity off for a condition.
{% endstep %}

{% step %}

#### Combine conditions

A single condition is often not enough. Use the **+ AND +** button to add a condition where both must be true, or the **+ OR +** button where either can be true. You can mix attributes and behavioral data in the same audience.

For example, to target new joiners in the warehouse who have not completed the safety guide, add an attribute condition for department equals "Warehouse," AND a behavioral condition for **First Time Active** within the last 30 days, AND a guide interaction condition for the safety guide not completed.
{% endstep %}

{% step %}

#### Check the preview

The **Audience Preview** at the bottom of the page shows how many users currently match. It updates as you add or change conditions, so you can see immediately whether the audience is too broad, too narrow, or matching nobody at all.

The count reads "0 of \[total] users currently represent this Audience" when no conditions are set, and adjusts as each condition takes effect.
{% endstep %}

{% step %}

#### Save the audience

Once the preview confirms the audience matches the intended users, save it. The audience then appears on the **Targeting** page with its name, last-updated date, usage count, and type, and you can apply it to content or select it as a filter on any analytics page.
{% endstep %}
{% endstepper %}

## Condition types for behavioral data

Behavioral conditions target what a user has done rather than who they are, and they need no attribute setup at all. Userlane collects the underlying data automatically from the moment the browser extension or snippet is active. Most practical audiences combine behavioral conditions with attribute conditions, for example targeting users in a specific department who have not completed a particular guide.

### First Time Active

The date Userlane first detected the user. This value is set once and never changes, which makes it reliable for onboarding-style audiences ("show this announcement to anyone in their first week").

Two timeframe types are available.

**Relative timeframes** look backward or forward from today and adjust automatically each day. "From 7 days in the past to 3 days in the past" matches users whose first detection fell within that rolling window. "Exactly 7 days in the past" matches only users whose first detection was exactly seven days ago, so content shown on this condition appears for one day only.

**Absolute timeframes** use a fixed calendar date. "Before 1 December" matches everyone Userlane detected before that date. "After 1 December" matches everyone detected from that date onward.

### Last Time Active

The date Userlane last detected the user, updated on every session. Because the value changes each time the user logs in, relative timeframes are not useful for content targeting: by the time Userlane evaluates the condition, **Last Time Active** has already been updated to today. Absolute timeframes still work, and **Last Time Active** is useful for analytics filtering, where you want a snapshot of users active before or after a given date.

### Guide Interaction

Whether a user has started, not started, completed, or not completed a specific guide. Each condition row targets one guide by its guide ID. To build a sequence ("show guide B only after guide A is completed"), combine multiple guide interaction conditions with AND.

## Build an audience with AI

The **Build an Audience with AI** section at the top of the audience builder accepts a plain-language description and generates conditions from it. Describe the audience you want, for example "users whose role is admin and who were first active in the last 14 days," and select **Generate**. Userlane creates the condition rows, which you can review, adjust, and save like any other audience.

Four example prompts are provided to get started:

* Users who were first time active \[enter time period]
* Users who completed OR started Guide with ID \[enter Guide ID]
* Users with an attribute \[enter value]
* Users whose "role" attribute is \[enter value]

When describing a guide interaction, use the guide ID rather than the guide title. The guide ID is available on the guide's edit page in the [Editor](/assistance/a-tour-of-the-editor.md).

<div data-with-frame="true"><figure><img src="https://259567114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF6bxg8i3T6U4vZ3k7PHi%2Fuploads%2F6Fjz14cz2ywhVDJ3Ui39%2Fbuild%20an%20audience%20with%20ai.png?alt=media&#x26;token=933121c8-3508-400b-bc59-3edb0b20308d" alt="The Build an Audience with AI section of the audience builder, with a prompt field and example prompts"><figcaption><p>Describe the audience in plain language and Userlane generates the conditions.</p></figcaption></figure></div>

## Where audiences are used

Once saved, an audience serves two purposes.

**Content targeting.** Apply an audience to a piece of content so that only matching users see it. Audiences can be applied to guides, chapters, announcements, surveys, Net Promoter Score (NPS) surveys, tooltips, and the [AI Assistant](/assistance/the-assistant.md). [Goals](/intelligence/goals.md) can also be scoped to an audience so that progress is tracked for a specific group. The **Usage** column on the **Targeting** page shows where each audience is currently applied.

**Analytics filtering.** On any analytics page, including [HEART](/intelligence/heart.md), **Content Analytics**, and **Audience Analytics**, select an audience from the filter to view results for that group. This makes it possible to compare adoption between departments, roles, or any other attribute without creating separate reports.

## Why an audience matches nobody

The audience preview shows "0 of \[total] users" when no users meet the conditions. Before contacting support, check these common causes:

* **The attribute has no values.** If the attribute source has not synced yet, or if values were sent for an attribute that does not exist in the portal, no user will have a value to match against. Connected sources sync once a day; the first values arrive within about fifteen minutes of connecting. Check the attribute's values under **Settings** > **Company attributes** or **Settings** > **Application attributes**.
* **Case mismatch.** Attribute values are matched case-sensitively by default. If the condition says "Admin" but the attribute values are "admin," no user matches. Turn off case sensitivity for that condition.
* **Typo in the condition value.** The **Equals** connection type requires an exact match. A trailing space or a misspelling causes a miss that is not obvious at a glance.
* **The attribute was recently created.** New attributes from connectors populate after the next sync cycle. A manually uploaded attribute is available immediately, but only for users included in the upload file.

## Relevant articles

{% content-ref url="/pages/TKBRGmMaapWk0xuF3XwG" %}
[Audiences](/administration/audiences.md)
{% endcontent-ref %}

{% content-ref url="/pages/gtcOzAVjL7zzv75As2Jd" %}
[Attributes](/administration/attributes.md)
{% endcontent-ref %}

{% content-ref url="/pages/heUmxS6HxlGKqCQSjqbs" %}
[Attribute sources](/administration/attributes/attribute-sources.md)
{% endcontent-ref %}

{% content-ref url="/pages/BkK6BtMQAoCXdpgXSBa5" %}
[Targeting](/assistance/content-operations/targeting.md)
{% endcontent-ref %}

{% content-ref url="/pages/NFn4yfhEX6UQ4Oy1WPAW" %}
[Audiences: design, test, and keep them accurate](/best-practices/audiences-design-test-and-keep-them-accurate.md)
{% endcontent-ref %}

## FAQ

<details>

<summary>What is the difference between AND and OR when combining conditions?</summary>

AND means every condition in the group must be true for a user to match. OR means any one condition in the group can be true. Combining both lets you build rules like "department is Warehouse AND (role is Manager OR role is Team Lead)."

</details>

<details>

<summary>Do behavioral conditions need any attribute setup?</summary>

No. Userlane collects **First Time Active**, **Last Time Active**, and **Guide Interaction** automatically from the moment the browser extension or snippet is active. Behavioral conditions can be used immediately without connecting a source or uploading a file.

</details>

<details>

<summary>Can an audience combine attribute conditions and behavioral conditions?</summary>

Yes. The AND/OR logic applies across all data types. A single audience can include conditions on attributes, behavioral data, **Customer User ID**, and Tags in any combination.

</details>

<details>

<summary>Is audience matching case-sensitive?</summary>

Yes, by default. The audience builder has a control to turn case sensitivity off for a given condition, so that "Manager" and "manager" are treated as the same value.

</details>

<details>

<summary>What happens to content when an audience is deleted?</summary>

An audience that is in use by an active goal cannot be deleted. For other content types, check whether the audience is still applied before removing it, because deleting an audience that content depends on may change who sees that content.

</details>

<details>

<summary>How do I find a guide's ID for a guide interaction condition?</summary>

Open the guide in the Editor. The guide ID is shown on the edit page. Use this ID, not the guide title, when you create a guide interaction condition or describe one to the AI builder. You can also find guide IDs by exporting the **List of Guides** from **Content Analytics** > **Guides** > **All Guides**.

</details>

[^1]: An audience is a reusable group of users defined by conditions on attributes, behavior, or both. Audiences target content to specific users and filter analytics results.

[^2]: Behavioral data is information Userlane collects automatically about what a user has done: when they were first and last active, and which guides they started or completed. No attribute setup is required.

[^3]: A page rule controls where content appears based on the URL or page context, as distinct from an audience, which controls who sees it. Audiences and page rules are managed together on the Targeting page.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.userlane.com/administration/audiences/build-an-audience-from-attribute-rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
