Skip to content

Update to audience trait operators #7723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions src/engage/audiences/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,32 @@ When you build an audience based on audience membership, you use existing audien

To see which audiences reference a particular audience in their definitions, select the **Consumers** tab when viewing a classic or linked audience. This tab lists all dependent audiences, to help you understand and manage relationships between your audience segments.

### Time comparison

You can use the following time comparison operators in your audience definition:
- `before date`
- `after date`
- `within last`
- `within next`
- `before last`
- `after next`

Only ISO timestamps can be used with these operators. Additionally, these time comparison operators exclusively apply to custom traits.
If the timestamp is not a valid ISO timestamp (for example, a trailing `Z` is missing), Segment won't process the audience in real-time. Learn more about [real-time compute compared to batch](/docs/engage/audiences/#real-time-compute-compared-to-batch).
### Trait operators

| Operator | Description |
|--------------------------- |---------------------------------------|
| equals | Matches exact value. |
| not equals | Does not match exact value. |
| less than | Value is less than specified. |
| greater than | Value is greater than specified. |
| less than or equal to | Value is less than or equal to specified. |
| grater than or equal to | Value is greater than or equal to specified. |
| equals any of | Matches any of specified values. |
| contains any of | Includes any of specified values. |
| contains | Includes specified substring or value. |
| does not contain | Excludes specified substring or value. |
| starts with | Begins with specified substring. |
| ends with | Ends with specified substring. |
| exists | Value is present (not null). |
| not exists | Value is absent (null). |
| before date | Dates before specified date. |
| after date | Dates after specified date. |
| within last | Dates between X days ago and today. |
| within next | Dates between today and X days from now. |
| before last | All dates older than X days from today. |
| after next | All dates beyond X days from today. |

Only ISO timestamps can be used with time comparison operators. If the timestamp is not a valid ISO timestamp (for example, a trailing `Z` is missing), Segment won't process the audience in real-time. Learn more about [real-time compute compared to batch](/docs/engage/audiences/#real-time-compute-compared-to-batch).

**Note**: Timezones seen in the UI are based on your local timezone, but are converted to UTC on the backend.

Expand Down Expand Up @@ -409,4 +423,4 @@ This error occurs when creating audiences that reference each other, meaning aud
No. Traits located in the `context.traits` object of a Track event aren’t available in the Event Properties section of the Audience Builder. You can only use top-level event properties to define event-based audience conditions.

### How does the historical data flag work?
The **Include Historical Event Data** option lets you take past event data into account and control how much of it is considered when creating real-time audiences. You can set a lookback window (for example, the “last 90 days”) to limit the processed event data, or disable it entirely to use only data arriving after creation. For batch audiences, Segment includes historical data by default.
The **Include Historical Event Data** option lets you take past event data into account and control how much of it is considered when creating real-time audiences. You can set a lookback window (for example, the “last 90 days”) to limit the processed event data, or disable it entirely to use only data arriving after creation. For batch audiences, Segment includes historical data by default.