Skip to main content

Audience Filter: block audience editor

Audience filter is an editor that determines who sees the block. The Audience filter card appears on the settings screens of the Cart complement, Cart similar, Wishlist similar, Frequently ordered, Trending, Recently viewed, Repeat purchase, and Personal recommendations blocks, on the rules screen of the Similar products block, and in that block's automatic mode.

Why you need it​

A recommendation block often needs to reach a specific segment of users rather than everyone. For example:

  • "Toys for boys aged 5–10": only users whose user profile includes a child in that age range;
  • "Premium products": only users from Moscow and St. Petersburg;
  • "Weekend discounts": only newsletter subscribers.

Audience Filter lets you define rules like these without programming.

Rule structure​

First, choose the filter mode using the two radio buttons in the Audience filter card:

  • None: the default. No filter is applied, all users see the block, and the screen shows no additional fields.
  • By user attribute: enables the filter fields described below.

The filter fields appear only after you select "By user attribute". If the block screen is set to "None", you won't see any rule fields.

Start by choosing the attribute to filter by. These two fields are shared by the entire filter:

  1. User attribute sets: an attribute set, such as "User profile" (see attribute sets (opens in a new tab)).
  2. User attribute: an attribute within the set, such as "City" or "Is a subscriber".

Below them are the rule rows. Each rule has:

  • Condition: the comparison condition;
  • Attribute value (e.g., male): the value the user attribute is compared against (hidden for conditions that don't need a value);
  • Categories: the rule's own category tree, defining where the rule applies;
  • a Delete button, which removes the rule.

To add a rule, click Add rule.

The conditions available in the Condition field depend on the type of the selected attribute. For a string attribute, for example, you can use contains, does not contain, equal to, not equal to, contains any value, does not contain a value, value based on the pattern, and the same value as the selected attribute. For numbers and dates, more and less replace "contains" / "does not contain" and the pattern condition. For files, images, and text, only contains any value and does not contain a value are available.

A user attribute set is required

The set and attribute fields are populated from existing attribute sets for users (and forms). If your project doesn't have a suitable set yet, create one (for example, "User profile") and add attributes to it (Date of birth, City, Subscriber, and so on).

Filtering by age​

To filter by age, use a regular rule on a date user attribute, such as date of birth: select that attribute in the User attribute field, then set a condition (equal to, not equal to, more, less, and others) and a value in the rule rows.

Multiple rules​

You can add multiple rules to Audience Filter. They are combined with AND logic: all rules must be true.

If you need OR logic between conditions, set it up through the attribute engine (see attribute types (opens in a new tab)) or use a composite value in a single attribute.

Content categories​

The last step is selecting the categories where the rule applies. Each rule has its own multi-select Categories tree. Clicking a category selects it along with its subcategories.

If no categories are selected, the rule is not applied. A warning appears under the tree: "No categories selected — the rule is not applied, and a user matching it will see the entire block". A user who matches such a rule sees the entire block.

Default behavior​

By default, the Audience filter card is set to None, so the block is shown to all users on every page it is linked to. Switch to "By user attribute" only when you need segmentation.

Testing a rule

Before publishing the block, check how the audience rule behaves. Click Open in modal to open the preview window, then go to the Investigate tab. It shows which rule was applied (in the Audience rule applied section) and any warnings the system reported.