Compute your audience from stored data
Build a Query segment from anything held in your datamart, and get it ready to activate.
Your goal
Express criteria over the data already in your datamart, and end up with a populated, activation-ready Query segment.
Expected outcome
A Query segment holding the users who match your criteria, ready to be activated, reused in other segments, analysed, or exported.
When this is useful
Whenever the criteria that define your audience are already recorded: profile attributes, past events, purchases, imported CRM fields, computed fields, model scores, or membership of another segment. This is the default way to build an audience, and the type most other features expect.
Prerequisites
The fields you want to query exist in your schema and are indexed for querying.
You know which builder you will use. See Segment builders - the choice depends on what you know, not on what you are building.
Key concepts
The count you see in a Builder or a segment does not mean the segment is populated and ready to be activated.
Before you save, you choose whether the segment is persisted and how often it is computed. Both settings exist only on Query segments.
If you are working in the Standard Segment Builder, these are your vocabulary.
Build and save a Query segment
Choose your builder
Pick by the knowledge available to the person building the segment:
Business user, no schema expertise: Standard Segment Builder.
Comfortable with the schema, wants AND / OR conditions: Advanced Segment Builder.
Schema or data expert: Expert OTQL Builder.
Express the criteria
Assemble your conditions. In the visual builders, remember which control does what:
In the Standard Segment Builder, each Include narrows the audience and each + widens it.
In the Advanced Segment Builder, objects carry field conditions and an optional minimum frequency, and groups carry the include / exclude and
and/orlogic.
Decide persistence and evaluation period
Fill in the advanced fields deliberately:
Persisted. Ticked by default. Leave it ticked if you will activate the segment through a feed, reference it in another segment's query, use it in analytics, or export it. Untick it if you only need its stats and dashboard - persistence has a computational cost. You can change this later.
Evaluation period. Default 1 day, and a maximum rather than a promise: the segment may be computed sooner depending on platform load.
Technical name. Set it if an external system needs to address this segment. It must be unique across your segments.
Attach processing activities if you enforce consent on the segment
This step is optional. To enforce consent on the segment, attach the processing activities that justify it. For a Query segment, consent is enforced by adding implicit conditions to the query itself, so attach them before the segment is computed. See Enforce compliance on your audience.
Verification
The segment appears in Audience > Segments with the type
Query.After the first computation, the user count on the segment page is non-zero and close to the count the builder forecast.
If the segment is persisted, feeds can be attached to it and other segments can reference it. If you unticked persistence, they cannot - which is the expected behaviour, not a bug.
Troubleshooting
The builder counts users, but a feed on the segment sends nothing
The segment is not persisted, or has not been computed yet. See Persisted segment.
The count is far larger than expected
An empty parameter field in the Standard Segment Builder selects every value, not none. Check for unset fields.
The count collapsed after a schema change
A definition error alert is probably open on the segment. See Alerts.
The count is right but activation reaches few users
Identifier coverage, not segment size. See The numbers that matter.
You need the count as of right now, not as of last night
Query it directly. See Check your audience reach and stats.
Related pages
Last updated
Was this helpful?