Audience features
The parametric OTQL queries that turn schema knowledge into business selectors in the Standard Segment Builder.
What one looks like
An audience feature is a pre-created, parametric OTQL query that appears in the interface as a user-friendly selector. It is built to match a business need, so the person building a segment picks "transactions made" and a date range rather than writing a query.
Take this query:
SELECT @count{} FROM UserPoint WHERE
events {
nature = "$transaction_confirmed" and
date >= $date
and products {brand in $brand and name in $name}
}Technically it is an OTQL query against your schema, with parameters registered in it. Functionally it is a business feature your users will reach for regularly: Users who made a transaction in a date range, for particular products. In the builder they see three selectors - date, brand, name - and no OTQL at all.
By combining audience features, users create most of their segments in business terminology.
Writing the query behind one
Parameters use the $parameter_name syntax. The field in the audience feature takes the name you write after the $, spaces are not allowed in it, and the type of selector is chosen automatically from the field's type.
// The gender will be selectable by the user
SELECT @count{} FROM UserPoint
where profiles {gender in $gender}
// The date will be selectable by the user,
// but the nature will always be $transaction_confirmed
SELECT @count{} FROM UserPoint
where events { nature = "$transaction_confirmed" and date >= $date }One value or several
The operator decides whether the selector is single- or multi-valued. Use in rather than == to let the user pick more than one value.
Frequency as a parameter
The @ScoreSum directive turns a frequency into a selector:
Create an audience feature
How many to create
You can create a maximum of 21,000 audience features. That ceiling is not a target.
To begin
About 20 features, representing your main business concepts.
With more time
More, but keep the total around 100.
A user gets access to the Standard Segment Builder as soon as one audience feature exists, but one feature creates no value. Good knowledge of the schema, and of the queries your datamart actually gets asked, is what makes the feature set useful. A workable process:
Know your schema. What is it optimised for? Which queries are created regularly? What are your current segments, and what are their queries?
Set up audience features, in the interface or by script.
Monitor usage, and update the features regularly.
Folders
Audience features can be stored in folders. Create one from Settings > Datamart > Datamarts, click the datamart, then Audience Features > Add folder. Any feature without a folder is assigned to the root folder.
Edition and deletion protection
The platform deliberately makes it hard to break segments that depend on a feature.
Updating a feature's query
Allowed but not recommended. It affects every segment using the feature. Prefer creating a new feature - the popup offers a link to do so.
Deleting a feature
Not allowed while it is used. Remove the feature from the segments first.
Deleting a folder that contains features
Not allowed. Delete every feature inside it first.
Related pages
Last updated
Was this helpful?