Audience Filter — Audience Block Editor
Audience filter — an editor that determines who will see the block. The Audience filter card is available on the settings screens for the Cart complement, Cart similar, Wishlist similar, Frequently ordered, Trending, Recently viewed, Repeat purchase, Personal recommendations blocks, as well as on the rules screen for the Similar products block.
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" — only to users from Moscow and St. Petersburg;
- The block "Weekend discounts" — only to newsletter subscribers.
The Audience Filter allows you to describe such rules without programming.
Rule Structure
First, select the filter mode — a toggle with two radio buttons in the Audience filter card:
- None — the default value. The filter is not applied, the block is visible to all users, and there are no additional fields on the screen.
- By user attribute — enables the filter fields described below.
The filter fields appear only after selecting "By user attribute" — if "None" is selected on the block screen, you will not see the rule fields.
First, choose which attribute to filter by. These two fields are common to the entire filter:
- User attribute sets — a set of attributes, for example, "User Profile" (see attribute sets).
- User attribute — an attribute within the set, such as "City" or "Is a subscriber".
Next come the rule lines. Each rule consists of:
- Condition — the comparison condition;
- Attribute value (e.g., male) — the value against which the user attribute is compared (for conditions that do not require a value, the field is hidden);
- Categories — its own category tree in which this rule applies;
- Delete button — removes the rule.
A new rule is added with the Add rule button.
The set of conditions in the Condition field depends on the type of the selected attribute. For example, for a string attribute, the following are available: contains, does not contain, equal to, not equal to, contains any value, does not contain a value, value based on the pattern, the same value as the selected attribute. For numbers and dates, instead of "contains" / "does not contain" and pattern, more and less are available, while for files, images, and text — only contains any value and does not contain a value.
The fields "set → attribute" are filled from existing sets of user attributes (and forms). If there is no suitable set in the project yet — create one (for example, "User Profile") and add attributes (Date of Birth, City, Subscriber, etc.).
Age Filter
Age is set using a regular rule based on a user attribute with a date — for example, by date of birth: select this attribute in the User attribute field and set the condition (equal to, not equal to, more, less, etc.) with the value in the rule lines.