Skip to main content

Audience Filter — audience block editor

AudienceFilterEditor is a separate editor that defines who will see the block. It is available on all Wave-2 settings screens (Cart complement, Cart similar, Wishlist similar, Frequently ordered, recommendation blocks).

Why is this needed

Often, a recommendation block should not be shown to everyone, but to a specific segment of users. For example:

  • The block "Toys for boys aged 5–10" should only be shown to those whose user profile includes a child of that age;
  • The block "Premium products" should only be shown to users from Moscow and St. Petersburg;
  • The block "Weekend discounts" should only be shown to newsletter subscribers.

The Audience Filter allows you to describe such rules without programming.

Rule structure

Each audience rule is built according to a cascading selector scheme:

  1. Set of attributes — for example, "User Profile" (see sets of attributes).
  2. Attribute within the set — for example, "Age", "City", "Is a subscriber".
  3. Operatorequals, in range, is in list, etc.
  4. Value — a specific value, range, or array of values (depending on the operator).
  5. Content categories — multi-selection of pages where this rule applies.

After filling in all five fields, the rule is saved and applied to the block.

⚠️User attribute set needed

The cascade "set → attribute" is filled from existing sets of user attributes. If there is no suitable set in the project yet, create one (for example, "User Profile") and add attributes (Age, City, Subscriber, etc.). For the age rule (range min..max), a numeric attribute is needed — the range will not appear on string attributes.

Age attribute

There is a separate type for age — ageAttribute. This rule has a numeric range min..max, separately described in Swagger DTO (ageAttribute / ageValueType / ageValue).

On the front end, this provides a convenient range input with two fields (from — to), rather than a single value:

  • min = 5, max = 10 — users aged from 5 to 10 years.
  • min = 18, max = null — users older than 18 (with no upper limit).
💡When to use

ageAttribute is convenient for age segmentation (children's products, 18+, seniors) — without it, you would have to describe the range with two separate rules.

Multiple rules

In the Audience Filter, you can add multiple rules — they are applied with an "AND" logic (all rules must be true).

If you need "OR" logic between conditions, configure them through the attribute engine (see attribute types) or use a composite value in one attribute.

Content categories

The final step is selecting categories where the rule applies. This is a multi-selection of project pages.

If no categories are selected, the rule applies globally (on all project pages where this block is embedded).

Out-of-the-box behavior

If the Audience Filter is not configured, the block is shown to all users on all pages where it is attached. Enable the filter only when you need segmentation.

ℹ️Testing the rule

Before publishing the block, check how the audience rule will work — open the Preview Modal and look at the Investigate tab: it shows which rule was applied (appliedAudienceRule) and what warnings the system issued.