Recommendations

Use the Recommendations API and tag to take advantage of machine learning-powered recommendations for your content. Recommendations are powered by resources, which are defined at the site level using custom schema.
Resource Filters
Learn more about calling resources directly in Look-Ups.
Resource filters are useful for narrowing your search, which returns results faster. You can use resource filters on either the resources or recommendations API calls.
Field Types
While each account has custom fields, these fields must map to one of the following field types. The Sample Values column shows how data is usually stored on the resource. The How to Filter in Payloads column shows what API callers typically send when using the simple JSON format or colon strings.
Type Name | Definition | Sample Values | How to Filter in Payloads |
|---|---|---|---|
TEXT | Freeform string |
| JSON: string in array, e.g. Colon: plain text; multiple values separated by the pipe character ` |
TAGSET | Set of string tags |
| Same as TEXT: each entry is a string. Matching lowercases for comparison. |
FLAG | Boolean |
| JSON: use JSON booleans only — |
COUNT | Integer amount |
| JSON: integer in array, e.g. Colon: YAML parses numbers, e.g. |
USD | Currency (US dollars) |
| JSON: number, e.g. Colon: |
SCORE | Floating-point score |
| JSON: number. Colon: YAML number. |
DATETIME | Absolute point in time (publish time, expiry, etc.) | Stored internally as a numeric instant (typically seconds since the Unix epoch, 1970-01-01 00:00:00 UTC). APIs that expose the resource may show this as a number or as an ISO-8601 timestamp string depending on the endpoint — that is only the stored value, not the colon-filter syntax. | Compact filters and simple JSON ( Advanced JSON: use |
URI | String URI |
| JSON: string(s) in Colon: string segment(s). |
GEO_POINT | Latitude / longitude | JSON object | The simple |
Your site’s schema decides the type of each field name. If an operator is not valid for that field’s type, the API returns an error.
Preferred Filter Syntax
There are three ways to represent filters in the Recommendations API — simple JSON array, colon format, and advanced JSON object (thrift/schema style) — but we highly recommend using a simple JSON array because it’s easy to generate, read, and parse differences.
Format | Definition | Sample Values |
|---|---|---|
Simple JSON array
| Send an array of objects. Each object has the same three logical fields as
|
CODE
|
Compact filter strings (colon format) | Used by the compact parser ( Format: exactly three segments separated by colons (the field name must not contain a colon):
CODE
|
CODE
|
Advanced JSON nested object | A single JSON object whose top-level keys are logical operators or filter kinds ( That form is verbose and is what you usually see inside named filter definitions in the site schema. The public APIs allow a single object instead of an array in some places (Recommendations |
CODE
A production schema contains many more keys; only the structure above is required for each named filter value. |
Operators
Operator names are case-insensitive. = and EQUAL mean the same as OR with a single value.
Operator | Definition | Field Types | Limitations | Simple JSON Array Sample |
|---|---|---|---|---|
| Exact match | Text, Tagset, Flag, Count, USD, Score, URI |
|
CODE
|
| Must not match any listed value | Text, Tagset | For booleans, use |
CODE
|
| Substring match | Text only |
|
CODE
|
| Field present or absent | Text, Tagset, Flag, Count, USD, Score, Datetime, URI, Geo Point | Must use real, unquoted JSON booleans: |
CODE
|
| Bounds | Count, USD, Score, Datetime | Requires exactly 2 values. Datetime supports ISO-8601 durations only (e.g., Each bound is checked with “greater than or equal” on the lower side and “less than or equal” on the upper side. So both endpoints are inclusive: a value equal to the minimum or maximum still matches. |
CODE
|
Recommendations
For API documentation, visit Recommendations (Basic).
Recommendations Tag
|
This tag creates a variable called articles and assigns it an array of resource objects based on the entered count (in this example, 3). The number of recommendations you retrieve should be the number of resources you will utilize in your content.
You can add the tag and the array created anywhere in your content. The contents of the returned array can be viewed in content using {{articles}}, or you can populate the contents of the resources with the syntax {{articles[0].title}}. To narrow recommendations to specific types of resources or based on other metadata, you can add filters.
Recommendations trigger events when a recommendation or recommendation set is requested, served, viewed, or clicked. You can easily access them in Report Builder as an Events report, where you'd find any recommendation events with the following event types: ![]() |
Filtered Recommendation Tag
|
This tag includes a filter for the metadata of resources where the resource type is an article.
Additional filters, such as user properties, can be added by separating them with a pipe.
For example:
|
You can swap out the filter operator for any valid operator (=, CONTAINS, NOT, AFTER, BEFORE, BETWEEN). An empty string (no operator specified) is treated the same as having equality (=):
|
This will filter to resources that contain either “dogs” or “cats” as a keyword:
|
This will filter to resources with the color field set to “red”:
|
To include multiple recommendations in an email without clipping, avoid using pipes ("|") between resource IDs in dynamic values. Instead, enter the resource IDs one by one by clicking the "+" sign in the field. The system is designed to handle values individually, so adding 3-4 IDs at once should be done by entering them one at a time.
Filtered Contains Tag
Read more about available operators for Recommendations.
For example:
|
For a list of resources, it's similar:
|
The available operators for both of these in email are documented in the table below:
Operator | Description |
'=' (EQUALS) | Can also be empty quotes '' |
'CONTAINS' | Includes the provided value as a portion of the field value. |
'NOT' | Does not equal |
'BEFORE' | Prior to the time period relative to the current date (3 days ago, 7 days from now, etc.) Only works with valid date fields |
'AFTER' | After a time period relative to the current date (3 days ago, 7 days from now, etc.). Only works with valid date fields |
Filtering could reduce the quality of personalization. The Recommendations engine will override the filter if it cannot retrieve the requested number of recommendations.
The filter names are all dependent on the available resource fields. If a resource has an author, you can filter by it. If not, it doesn't work.
Filters have very specific formats that must be respected when building your query. For example,
sku_last_updated GREATER THAN 13 hours agowon’t return any results because it’s not a valid format; instead, use'sku_last_updated', 'BEFORE', '-PT13H'.Filters for
bt_created_atandbt_updated_atare only supported for resources uploaded after .It's important to note that the image URLs are hosted on the client's server, not on Zeta's infrastructure.
