Skip to main content

Creating and editing a recommendation strategy

Learn how to create and edit a recommendation strategy, and define the settings for the strategy.

Creating a recommendation strategy

To create a recommendation strategy:

  1. In the Frosmo Control Panel, in the sidebar, select More > Recommendations.

  2. Click Create recommendation strategy.

  3. Define the recommendation strategy settings.

    Creating a recommendation strategy
  4. When you're done, click Save. The Frosmo Platform generates the recommendation data for the new strategy. The data generation may take several minutes.

    The platform automatically regenerates the recommendation data at regular time intervals. The exact regeneration frequency depends on the algorithms used by a strategy.

  5. Once the recommendation data has been successfully generated, preview the results.

  6. To return to the recommendation strategies list, click Cancel.

You can now use the strategy in a modification to build and display a recommendation.

Editing a recommendation strategy

warning

Be careful when editing a recommendation strategy that is in use, since changes to the strategy affect all modifications that use it. In particular, if you edit a strategy that is currently used in an active variation of an active modification, the changes will affect all visitors who see the variation content.

tip

If you want to make major changes to a strategy, such as change its algorithms or filters, it is recommended that you first duplicate the strategy and associated modification, test the changes with the duplicates, and update the original strategy only after you're happy with how its duplicate works. You might even consider switching to using the duplicate strategy, while leaving the original unchanged. This way, you can always revert back to the original strategy, if necessary.

To edit a recommendation strategy:

  1. In the Frosmo Control Panel, in the sidebar, select More > Recommendations.

  2. In the recommendation strategies list, find the strategy you want to edit, and click the strategy name.

  3. Edit the recommendation strategy settings.

  4. When you're done, click Save. The Frosmo Platform regenerates the recommendation data for the updated strategy. The data generation may take several minutes.

    note

    The platform automatically regenerates the recommendation data at regular time intervals. The exact regeneration frequency depends on the algorithms used by a strategy.

  5. Once the recommendation data has been successfully generated, preview the results.

  6. To return to the recommendation strategies list, click Cancel.

Previewing recommendation results

The recommendation data returned by a strategy is based on the following factors:

Moreover, the algorithms, filters, and affinity-based sorting depend on dynamic contextual factors such as the particular web page on which the recommendation gets displayed or the individual visitor who sees the recommendation. For example, a smartphone product page will show different recommendations than a toilet brush product page, and a visitor with a strong affinity for Apple devices will see different recommendations than a visitor with a strong affinity for Samsung devices.

You can preview the recommendation data for a strategy in the Frosmo Control Panel. You can simulate different real-world situations by defining the relevant contextual information for the preview.

To preview the recommendation data for a strategy:

  1. In the Frosmo Control Panel, in the sidebar, select More > Recommendations.

  2. In the recommendation strategies list, find the strategy whose data you want to preview, and click the strategy name.

  3. In the Preview section, define the necessary contextual information for generating the preview:

    • Visitor ID: If you want to preview the data as personalized for an individual visitor, enter the visitor's Frosmo ID. If you do not enter an ID, the data is not personalized. This field is visible only when the strategy applies settings that personalize the recommendation for individual visitors. If the strategy uses only "by the visitor" algorithms, this field is required.

      tip

      You can use the visitor explorer to browse the visitors tracked for the site, view an individual visitor's interaction profile, and preview personalized content for an individual visitor.

    • Depending on the selected page type, define the appropriate information:

      • Brand: Define the brand whose page you want to simulate. To define the brand, start typing its name in the field, and select the brand from the autocomplete list.

      • Cart items: Define one or more items to simulate the shopping cart contents. To define an item, start typing its ID or name in the field, select the item from the autocomplete list, and click Add.

      • Categories: Define one or more categories to simulate a category page. These are the categories whose items are shown on the simulated category page. To define a category, start typing its name in the field, select the category from the autocomplete list, and click Add.

      • Item: Define the item whose page you want to simulate. To define the item, start typing its ID or name in the field, and select the item from the autocomplete list.

      • Search results: Define one or more items and/or categories to simulate the search results. The former represent the matches returned by the search, while the latter represent the categories to which the returned items belong. To define an item, start typing its ID or name in the item field, select the item from the autocomplete list, and click Add. To define a category, start typing its name in the category field, select the category from the autocomplete list, and click Add.

    Defining contextual information for generating the preview
    tip

    If you edit the strategy in between previewing the recommendation data, you need to regenerate the data after each edit. To regenerate the data, click Save.

    Regenerating the recommendation data
  4. Click Show.

  5. View the data.

    The preview displays the recommended items in slot order, that is, in the order in which the items are recommended to visitors. The preview also displays selected information, such as ID and name, for each item. Finally, the preview provides two links for each item: one to the item details page in the Frosmo Control Panel, and the other to the item page on the site, such as a product page.

    Previewing the recommendation data of a strategy

Recommendation strategy settings

The following table describes the settings you can define for a recommendation strategy in the Frosmo Control Panel.

Recommendation strategy settings
SettingDescriptionRole

Name

Enter a name for the strategy.

Required

ID

The Control Panel automatically generates a unique ID for the strategy based on the name.

You can edit the ID when you create a new strategy, but only until you save the strategy for the first time. Once you save the strategy, the ID becomes non-editable.

Required

Description

Enter a description for the strategy. You can use the description to, for example, explain what sort of recommendation the strategy generates.

Optional

Page type

Select the type of page on which the recommendation is displayed. The page types available for your site depend on the site's vertical.

If the recommendation is displayed on multiple types of pages, select Other.

If the strategy is for an email recommendation, select Email.

The page type determines the available algorithms.

Required

Fixed items

Define the items that are always included ("fixed") in the recommendation.

You must at minimum define either one algorithm or one fixed item for the strategy.

If a fixed item also appears in the results generated by an algorithm, the platform automatically removes the duplicate from the final set of items returned by the strategy.

Sorting does not affect fixed items. For example, if you have a fixed item in slot 2, the platform always returns the item in slot 2 and simply excludes slot 2 from the sorting.

Adding a fixed item

To add a fixed item:

  1. Click Add item. The Control Panel adds an undefined item.

  2. In the empty field, start typing the item name or ID, and select the item you want. The field automatically lists items tracked for the site.

    Selecting the item
  3. Enter the slot number for the item. The slot number determines the item's absolute position in the recommendation results. The position is not affected by algorithms, filters, or shuffling. For example, if you set the slot number to "1", the item is always displayed first in the recommendation. You cannot enter the same slot number for multiple items.

    Entering the slot number for the item
Editing a fixed item

You can change the selected item and slot number of a fixed item.

Removing a fixed item

To remove a fixed item, click for the item.

Removing a fixed item

Optional

Algorithms

Select the algorithms for the strategy. The algorithms together determine the dynamically generated set of items returned by the strategy. You can further refine the set by applying filters and sorting.

You must at minimum define either one algorithm or one fixed item for the strategy.

You can select a maximum of five algorithms. A new strategy includes a single preselected algorithm, which you can change.

How algorithms work

The platform runs each algorithm separately against the same source usage data and combines the results of the algorithms in the order in which the algorithms are selected. For example, if you have Bought together with current item - 60 days with 5 items as your first algorithm and Viewed together with current item - 30 days with 3 items as your second algorithm, the strategy returns a total of eight items: the first five items are the top five items from the former algorithm and the remaining three items are the top three items from the latter algorithm.

The platform automatically reruns the algorithms at regular time intervals, thereby periodically regenerating the recommendation data returned by the strategy. The platform reruns each algorithm separately based on its regeneration frequency. If you select multiple algorithms with different regeneration frequencies, some parts of the data returned by the strategy will be updated more frequently than other parts. To find out the frequency of an algorithm, see Supported algorithms.

Adding an algorithm

To add an algorithm:

  1. Click Add algorithm. The Control Panel adds an algorithm with default settings.

  2. Select the algorithm you want to use. For more information about the supported algorithms, see Supported algorithms.

    Selecting the algorithm
  3. Enter the maximum number of items returned by the algorithm. The algorithm will always return this many items, unless it cannot find enough items matching its criteria.

    Entering the maximum number of items returned by the algorithm
Changing an algorithm

You can change the selected algorithm and the maximum number of items returned by the algorithm.

Removing an algorithm

To remove an algorithm, click for the algorithm.

Removing an algorithm

Optional

Global filters

List of filters applied to all strategies on the site. If the site has no global filters defined, this section is not shown.

To create, edit, and remove global filters, see Defining global recommendation strategy filters.

Optional

Filters

Create filters to further refine the set of items returned by the strategy.

The platform also provides predefined filters for certain page types. You can select to apply some of the predefined filters, while the platform automatically applies others.

The platform applies the filters separately to the full results of each algorithm, removing items based on the filter settings. The platform then picks the top items for each algorithm, and combines the top items and any fixed items into the final set of recommended items returned by the strategy.

note

The platform does not apply filters to the results of the Based on the visitor's affinity algorithm.

note

When the selected page type for the recommendation strategy is Article/Game/Product, the currently viewed item is excluded from the recommendation data by default.

Applying predefined filters

For information about the predefined filters and when to apply them, see Predefined filters.

Adding a filter

To add a filter:

  1. Click Add filter. The filter settings open.

  2. Define the filter settings.

  3. Click Save.

Editing a filter

To edit a filter:

  1. Click Edit for the filter. The filter settings open.

    Editing a filter
  2. Edit the filter settings.

  3. Click Save.

Removing a filter

To remove a filter, click for the filter.

Removing a filter

Optional

Sorting

Select how the recommendation results are sorted:

  • Default: Sort the recommended items in descending order of rank as determined by the algorithms. The more highly an algorithm recommends an item, the higher the rank that the algorithm assigns to the item. The item with the highest rank is displayed first in the recommendation.

  • Affinity: Sort the recommended items based on visitor affinity. For more information, see Configuring affinity-based sorting.

    note

    This sorting option is not available if the page type of the strategy is Email.

  • Oldest to newest: Sort the recommended items from oldest to newest based on the value of the availableOn attribute of each item. This option is only available if the item data for the site includes the availableOn attribute (as a datetime string).

  • Newest to oldest: Sort the recommended items from newest to oldest based on the value of the availableOn attribute of each item. This option is only available if the item data for the site includes the availableOn attribute (as a datetime string).

  • Conversions ascending: Sort the recommended items in ascending order by the number of conversions in the past 30 days. Conversions include both transactions and, if tracked, non-purchase conversions.

  • Conversions descending: Sort the recommended items in descending order by the number of conversions in the past 30 days. Conversions include both transactions and, if tracked, non-purchase conversions.

  • Price ascending: Sort the recommended items in ascending order by price. This option is only available if the item data for the site includes the price attribute (as a number or numeric string).

  • Price descending: Sort the recommended items in descending order by price. This option is only available if the item data for the site includes the price attribute (as a number or numeric string).

  • Shuffled: Return the recommended items in a random order. The platform shuffles the items every time the recommendation gets displayed, including when a visitor reloads the page.

  • Views ascending: Sort the recommended items in ascending order by the number of views in the past 30 days.

  • Views descending: Sort the recommended items in descending order by the number of views in the past 30 days.

The platform sorts the recommendation results as a whole based on the selected sorting option: The platform first combines the filtered results of each algorithm and then sorts the full set of recommended items. The only exception to this is affinity-based sorting: If you select Affinity as the sorting option, the platform first separately sorts the filtered results of each algorithm based on affinity and then combines the filtered and now affinity-adjusted results into the final set of recommended items.

note

The platform does not sort fixed items. For example, if you have a fixed item in slot 2, the platform always returns the item in slot 2 and simply excludes slot 2 from the sorting.

Configuring affinity-based sorting

Use the slider to set the level of visitor affinity applied to sorting the recommendation results.

Configuring affinity-based sorting

The higher the level, the more personalized the set of recommended items is for each individual visitor. Applying affinity reranks the items to a greater or lesser degree depending on the level of affinity selected and how closely a given visitor's affinities match the algorithm results.

The possible slider values are:

  • 0% (no affinity applied, an algorithm fully determines how the items it returns are ranked)

  • 25%

  • 50% (affinity and algorithm have equal weight in determining how the items returned by an algorithm are ranked)

  • 75%

  • 100% (affinity fully determines how the items returned by an algorithm are ranked)

If a visitor's affinity is not known, the platform does not apply any affinity to the recommendation for that visitor.

For more information about affinity and how it works, see Feature: Affinity.

Required

Defining the recommendation strategy settings
Figure: Defining the recommendation strategy settings

Supported algorithms

The following table describes the algorithms you can use in a recommendation strategy. The table also shows for which page types an algorithm is valid and how often the recommendation data returned by the algorithms is automatically regenerated.

Supported algorithms
AlgorithmDescriptionPage typeRegeneration

Based on the visitor's affinity

Returns the top items that match the visitor's affinity profile. The more closely and widely an item matches the visitor's affinities, the higher the item's ranking in the results.

If a visitor does not have an affinity profile, the algorithm returns nothing.

note

This algorithm is currently a beta-level feature.

info

The visitor's affinities are based on their past 60 days of site activity as tracked by the platform.

All (except Email)

Varies

Bought together with categories recently bought by the visitor

Returns items bought together (in the past 60 days) with the items the visitor has recently bought (in the past 7 days). The returned items are from the same category or categories as the items bought by the visitor.

Example

The visitor recently bought the following items:

  • Item A from category X one day ago

  • Item B from category Y five days ago

  • Item C from category Z nine days ago

The algorithm returns items from categories X and Y that visitors have commonly bought together with items A and B.

All (except Email)

1 day

Bought together with current brand

Returns items bought together (in the past 60 days) with items from the brand the visitor is currently viewing.

Brand

1 day

Bought together with current category

Returns items bought together (in the past 60 days) with items from the category the visitor is currently viewing.

Category

1 day

Bought together with current item

Returns items bought together (in the past 60 days) with the item the visitor is currently viewing.

Article

Game

Product

1 day

Bought together with items in the cart

Returns items bought together (in the past 60 days) with the items in the visitor's shopping cart. The algorithm considers a maximum of 20 shopping cart items.

Cart

1 day

Bought together with items recently viewed by the visitor

Returns items bought together (in the past 60 days) with the items the visitor has recently viewed (in the past 7 days).

All (except Email)

1 day

Most bought on the site in recent days

Returns the most bought items on the site in the past 7 days.

All

1 day

Most bought on the site in recent months

Returns the most bought items on the site in the past 60 days.

All

1 day

Most bought on the site in the past 24 hours

Returns the most bought items on the site in the past 24 hours.

All

1 hour

Most viewed by the visitor

Returns items the visitor has viewed the most in the past 14 days.

All (except Email)

Real-time

Most viewed on the site in recent days

Returns the most viewed items on the site in the past 7 days.

All

1 day

Most viewed on the site in recent weeks

Returns the most viewed items on the site in the past 30 days.

All

1 day

Most viewed on the site in the past 24 hours

Returns the most viewed items on the site in the past 24 hours.

All

1 hour

Recently bought by the visitor

Returns items the visitor has bought in the past 14 days.

All (except Email)

Real-time

Recently viewed by the visitor

Returns items the visitor has viewed in the past 14 days.

All (except Email)

Real-time

Viewed together with categories recently viewed by the visitor

Returns items viewed together (in the past 30 days) with the items the visitor has recently viewed (in the past 7 days). The returned items are from the same category or categories as the items viewed by the visitor.

Example

The visitor recently viewed the following items:

  • Item A from category X one day ago

  • Item B from category Y five days ago

  • Item C from category Z nine days ago

The algorithm returns items from categories X and Y that visitors have commonly viewed together with items A and B.

All (except Email)

1 day

Viewed together with current brand

Returns items viewed together (in the past 30 days) with items from the brand the visitor is currently viewing.

Brand

1 day

Viewed together with current category

Returns items viewed together (in the past 30 days) with items from the category the visitor is currently viewing.

Category

1 day

Viewed together with current item

Returns items viewed together (in the past 30 days) with the item the visitor is currently viewing.

Article

Game

Product

1 day

Viewed together with items recently viewed by the visitor

Returns items viewed together (in the past 30 days) with the items the visitor has recently viewed (in the past 7 days).

All (except Email)

1 day

Viewed together with recently searched categories

Returns items viewed together (in the past 30 days) with items from the three categories that feature most in the visitor's current search results.

Example

The visitors current search returns 20 items:

  • 2 items from category A

  • 5 items from category B

  • 8 items from category C

  • 2 items from category D

  • 3 items from category E

The algorithm returns items that visitors have commonly viewed together with items from categories C, B, and E.

Search

1 day

Viewed together with recently searched items

Returns items viewed together (in the past 30 days) with the top three items in the visitor's current search results.

Search

1 day

Predefined filters

The platform provides predefined filters for the following use cases.

Excluding items already in the visitor's shopping cart

If the Page type of the strategy is Cart, the Filters section displays the Exclude items already added to the cart checkbox. The checkbox is selected by default, and you cannot deselect it. The strategy automatically excludes items that are already in a visitor's shopping cart: If the visitor has a specific item in their cart, and if an algorithm recommends that item, the strategy automatically removes the item from the final set of recommended items for the visitor.

Excluding items already in the visitor's shopping cart
Figure: Excluding items already in the visitor's shopping cart

Excluding the currently viewed item

If the Page type of the strategy is Article/Game/Product, the Filters section displays the Exclude the currently viewed item checkbox. The checkbox is selected by default, and you cannot deselect it. The strategy automatically excludes the item that a visitor is currently viewing from the final set of recommended items for the visitor.

Excluding the currently viewed item
Figure: Excluding the currently viewed item

Excluding items recently viewed or bought by the visitor

If you want to exclude items the visitor has recently viewed, select Exclude items recently viewed by the visitor. The strategy will exclude up 20 of the most recently viewed items in the last 14 days.

Excluding items recently viewed by the visitor
Figure: Excluding items recently viewed by the visitor

If you want to exclude items the visitor has recently bought, select Exclude items recently bought by the visitor. The strategy will exclude up 20 of the most recently bought items in the last 14 days.

Excluding items recently bought by the visitor
Figure: Excluding items recently bought by the visitor

You can apply either or both filters.

Limiting the results to the viewed brand

If the Page type of the strategy is Brand, and if you only want to return items that belong to the brand currently viewed by the visitor, select Only return items whose brand matches the viewed brand.

Limiting the results to the viewed brand
Figure: Limiting the results to the viewed brand

Limiting the results to the viewed category

If the Page type of the strategy is Category, and if you only want to return items that belong to the category currently viewed by the visitor, select either Only return items whose type matches the viewed category or Only return items whose categories include the viewed category. The option available to you depends on the site's default item attribute for defining category: type (string) or categories (array of strings).

Limiting the results to the viewed category
Figure: Limiting the results to the viewed category

Limiting the results to the viewed item's categories

If the Page type of the strategy is Article/Game/Product, and if you only want to return items that belong to the same category or categories as the item currently viewed by the visitor, select either Only return items whose type is the same as the currently viewed item's or Only return items whose categories include at least one category that is the same as the currently viewed item's. The option available to you depends on the site's default item attribute for defining category: type (string) or categories (array of strings).

Limiting the results to the viewed item's categories
Figure: Limiting the results to the viewed item's categories

Limiting the results to searched categories

If the Page type of the strategy is Search, and if you only want to return items that belong to the same category or categories as the items returned by the search, select either Only return items whose type matches a searched category or Only return items whose categories include a searched category. The option available to you depends on the site's default item attribute for defining category: type (string) or categories (array of strings).

Limiting the results to searched categories
Figure: Limiting the results to searched categories

Filter settings

The following table describes the settings you can define for a filter. A filter comprises a single rule set for filtering recommended items.

Filter settings
SettingDescriptionRole

Name

Enter a name for the filter.

Required

Rules

Create one or more rules that together define the filtering logic for the filter.

A rule defines a single comparison operation between an item attribute value and a target value defined by you. The rule is used to include and exclude items from the final recommendation results: any item for which the rule evaluates to true is included, while any item for which the rule evaluates to false is excluded. The comparison is case-insensitive.

If you create multiple rules, the platform applies them all, that is, the platform treats the rules as combined with logical AND operators. The platform only returns items for whom all the rules evaluate to true.

The filter must include at least one rule. A new filter includes a single empty rule, which you can edit.

Example

If you wanted to exclude items that cost more than 100 in your site currency, you would filter for items whose price attribute value was less than or equal to 100, which would give you the rule:

price is less than or equal to 100

The platform would then evaluate every item in the algorithm results and remove any item for which the rule evaluates to false. The final recommendation results returned by the strategy would thus exclude these items. For example:

# Set of items returned by the algorithms

Item 1, price: 100
Item 2, price: 500
Item 3, price: 30

# Filter evaluation

Item 1, price: 100 -> TRUE
Item 2, price: 500 -> FALSE
Item 3, price: 30 -> TRUE

# Set of items returned by the strategy after applying the filter

Item 1, price: 100
Item 3, price: 30

For more examples, see Filter examples.

Adding a rule

To add a rule:

  1. Click Add rule. The Control Panel adds an undefined rule.

  2. Select the item attribute you want to use for filtering items. The field automatically lists the attributes tracked for the site.

    Entering the name of the item attribute
  3. Select the relational operator for comparing the item attribute value to the target value. The drop-down menu only displays operators that are valid for the data type of the selected attribute. For more information about the operators, see Filter rule operators.

    Selecting the relational operator for the comparison
  4. Enter or select the target value for the comparison. The field automatically lists the different values tracked for the specified item attribute (unless the attribute is an array).

    Entering the target value for the comparison

    The target value type depends on the operator. For more information about the target values, see Filter rule operators.

    If the target value is an array, use the Add button to individually enter the different values in the array. You can remove a value from the array by clicking for the value.

    Managing an array target value for the comparison
Editing a rule

You can change the attribute, operator, and value of a rule.

Removing a rule

To remove a rule, click for the rule.

Removing a rule

Required

Filter rule operators

The following table describes the relational operators supported in filter rules. The Attribute type and Target type columns list the types of item attribute values and target values, respectively, that the operators support. For example, the equals operator expects a Boolean, number, or string as the attribute value and a string as the target value.

note

The comparison is always case-insensitive.

Supported filter rule operators
OperatorDescriptionAttribute typeTarget type

equals

The rule evaluates to true if the attribute value equals the target value.

Rule: <type> equals "Fashion/Shoes"

type: "Fashion/Shoes" -> TRUE
type: "Fashion/Suits" -> FALSE

The platform converts the attribute value to a string for the comparison.

Boolean

Number

String

String

does not equal

The rule evaluates to true if the attribute value does not equal the target value.

Rule: <type> does not equal "Fashion/Shoes"

type: "Fashion/Shoes" -> FALSE
type: "Fashion/Suits" -> TRUE

The platform converts the attribute value to a string for the comparison.

Boolean

Number

String

String

is greater than

The rule evaluates to true if the attribute value is greater than the target value.

Rule: <price> is greater than 50

price: 40 -> FALSE
price: 50 -> FALSE
price: 60 -> TRUE

If the attribute is a number, the platform treats the attribute and the target value as numbers for the comparison.

Number

String

String

is less than

The rule evaluates to true if the attribute value is less than the target value.

Rule: <price> is less than 50

price: 40 -> TRUE
price: 50 -> FALSE
price: 60 -> FALSE

If the attribute is a number, the platform treats the attribute and the target value as numbers for the comparison.

Number

String

String

is greater than or equal to

The rule evaluates to true if the attribute value is greater than or equal to the target value.

Rule: <price> is greater than or equal to 50

price: 40 -> FALSE
price: 50 -> TRUE
price: 60 -> TRUE

If the attribute is a number, the platform treats the attribute and the target value as numbers for the comparison.

Number

String

String

is less than or equal to

The rule evaluates to true if the attribute value is less than or equal to the target value.

Rule: <price> is less than or equal to 50

price: 40 -> TRUE
price: 50 -> TRUE
price: 60 -> FALSE

If the attribute is a number, the platform treats the attribute and the target value as numbers for the comparison.

Number

String

String

contains

The rule evaluates to true if the attribute value contains or equals the target value.

Rule: <type> contains "shoes"

type: "Fashion/Shoes" -> TRUE
type: "Fashion/Suits" -> FALSE

String

String

does not contain

The rule evaluates to true if the attribute value does not contain or equal the target value.

Rule: <type> does not contain "shoes"

type: "Fashion/Shoes" -> FALSE
type: "Fashion/Suits" -> TRUE

String

String

begins with

The rule evaluates to true if the attribute value begins with or equals the target value.

Rule: <type> begins with "Fashion"

type: "Fashion/Shoes" -> TRUE
type: "Food/Seafood" -> FALSE

String

String

begins with any one of

The rule evaluates to true if the attribute value begins with or equals any one of the target values.

Rule: <type> begins with any one of ["Fashion", "Food", "Toys"]

type: "Fashion/Shoes" -> TRUE
type: "Food/Seafood" -> TRUE
type: "Home/Bedroom" -> FALSE

String

Array of strings

ends with

The rule evaluates to true if the attribute value ends with or equals the target value.

Rule: <type> ends with "Shoes"

type: "Fashion/Shoes" -> TRUE
type: "Food/Seafood" -> FALSE

String

String

is one of

The rule evaluates to true if the attribute value equals any one of the target values.

Rule: <brand> is one of ["Cakita", "Kosch", "Wakita"]

brand: "Cakita" -> TRUE
brand: "Dawelt" -> FALSE
brand: "Wakita" -> TRUE

The platform converts the attribute value to a string for the comparison.

Number

String

Array of strings

is not one of

The rule evaluates to true if the attribute value equals none of the target values.

Rule: <brand> is not one of ["Cakita", "Kosch", "Wakita"]

brand: "Cakita" -> FALSE
brand: "Dawelt" -> TRUE
brand: "Wakita" -> FALSE

The platform converts the attribute value to a string for the comparison.

Number

String

Array of strings

includes

The rule evaluates to true if any one of the attribute values equals the target value.

Rule: <features> includes "respins"

features: ["respins", "scatters", "wilds"] -> TRUE
features: ["paylines", "scatters", "wilds"] -> FALSE

The platform converts the attribute values to strings for the comparison.

The platform expects the attribute values to be of the same type.

Array of Booleans

Array of numbers

Array of strings

String

does not include

The rule evaluates to true if none of the attribute values equal the target value.

Rule: <features> does not include "respins"

features: ["respins", "scatters", "wilds"] -> FALSE
features: ["paylines", "scatters", "wilds"] -> TRUE

The platform converts the attribute values to strings for the comparison.

The platform expects the attribute values to be of the same type.

Array of Booleans

Array of numbers

Array of strings

String

includes any one of

The rule evaluates to true if at least one of the attribute values equals at least one of the target values.

Rule: <features> includes any one of ["respins", "wilds"]

features: ["respins", "scatters", "wilds"] -> TRUE
features: ["free spins", "paylines", "scatters"] -> FALSE

The platform converts the attribute values to strings for the comparison.

The platform expects the attribute values to be of the same type.

Array of Booleans

Array of numbers

Array of strings

Array of Booleans

Array of numbers

Array of strings

does not include any one of

The rule evaluates to true if none of the attribute values equals none of the target values.

Rule: <features> does not include any one of ["respins", "wilds"]

features: ["respins", "scatters", "wilds"] -> FALSE
features: ["free spins", "paylines", "scatters"] -> TRUE

The platform converts the attribute values to strings for the comparison.

The platform expects the attribute values to be of the same type.

Array of Booleans

Array of numbers

Array of strings

Array of Booleans

Array of numbers

Array of strings

any one of contains

The rule evaluates to true if any one of the attribute values contains or equals the target value.

Rule: <tags> any one of contains "sale"

tags: ["shirts", "short-sleeve", "top-rated"] -> FALSE
tags: ["shirts", "long-sleeve", "summer sale"] -> TRUE
tags: ["skirts", "sale 50%", "top-reviewed"] -> TRUE

The platform converts the attribute values to strings for the comparison.

The platform expects the attribute values to be of the same type.

Array of Booleans

Array of numbers

Array of strings

String

any one of begins with

The rule evaluates to true if any one of the attribute values begins with or equals the target value.

Rule: <tags> any one of begins with "top"

tags: ["shirts", "short-sleeve", "top-rated"] -> TRUE
tags: ["shirts", "long-sleeve", "summer sale"] -> FALSE
tags: ["skirts", "sale 50%", "top-reviewed"] -> TRUE

The platform converts the attribute values to strings for the comparison.

The platform expects the attribute values to be of the same type.

Array of Booleans

Array of numbers

Array of strings

String

any one of ends with

The rule evaluates to true if any one of the attribute values ends with or equals the target value.

Rule: <tags> any one of ends with "sleeve"

tags: ["shirts", "short-sleeve", "top-rated"] -> TRUE
tags: ["shirts", "long-sleeve", "summer sale"] -> TRUE
tags: ["skirts", "sale 50%", "top-reviewed"] -> FALSE

The platform converts the attribute values to strings for the comparison.

The platform expects the attribute values to be of the same type.

Array of Booleans

Array of numbers

Array of strings

String

during

The rule evaluates to true if the attribute value is inside the specified duration counting backwards from the current date and time of your Frosmo Platform instance.

The attribute must be one of the following datetime attributes:

The target value must be a duration string: a sequence of numbers followed by a unit suffix. The supported units are h (hours) and d (days). For example: 24h or 7d.

Rule: <created_at> during "10d"

Current time: 2022-09-10 12:00:00 UTC+2

created_at: "2022-09-01T15:00:00+02:00" -> TRUE
created_at: "2022-08-28T15:00:00+02:00" -> FALSE

The platform subtracts the attribute value from the current date and time, and compares the result to the target value (duration). If the result is less than or equal to the target value, the operation evaluates to true.

If the attribute value is a future datetime, the operation always evaluates to true. You therefore cannot filter out items whose datetime is in the future.

Example

The current date and time is 2022-09-10 12:00:00, the attribute value is 2022-09-01 15:00:00, and the target value is 10d. Subtracting the attribute value from the current date and time yields 8d 21h. The result is less than the target value, the operation evaluates to true, and the item is therefore included in the recommendation results.

String

String

not during

The rule evaluates to true if the attribute value is not inside the specified duration counting backwards from the current date and time of your Frosmo Platform instance.

The attribute must be one of the following datetime attributes:

The target value must be a duration string: a sequence of numbers followed by a unit suffix. The supported units are h (hours) and d (days). For example: 24h or 7d.

Rule: <created_at> not during "10d"

Current time: 2022-09-10 12:00:00 UTC+2

created_at: "2022-09-01T15:00:00+02:00" -> FALSE
created_at: "2022-08-28T15:00:00+02:00" -> TRUE

The platform subtracts the attribute value from the current date and time, and compares the result to the target value (duration). If the result is greater than the target value, the operation evaluates to true.

Example

The current date and time is 2022-09-10 12:00:00, the attribute value is 2022-08-28 15:00:00, and the target value is 10d. Subtracting the attribute value from the current date and time yields 12d 21h. The result is greater than the target value, the operation evaluates to true, and the item is therefore included in the recommendation results.

String

String

distinct values are limited to

The rule evaluates to true if the attribute value is the Nth or prior identical value, where N is the target value for the comparison.

The platform first sorts the recommended items in descending order by weight and then picks up to N items with an identical attribute value, starting from the top. For example, if you set the rule to 2 for the category attribute, and if the strategy initially returns three items that belong to category A, the platform omits the item with the lowest weight from the final results.

Example

The strategy initially returns the following recommended items, sorted by weight:

id: 1, category: "A", weight: 100
id: 4, category: "B", weight: 90
id: 9, category: "A", weight: 80
id: 3, category: "A", weight: 70
id: 2, category: "C", weight: 70
id: 5, category: "B", weight: 50
id: 6, category: "B", weight: 10

If you set distinct values are limited to to 2 for the category attribute, the strategy returns the following recommended items:

id: 1, category: "A", weight: 100
id: 4, category: "B", weight: 90
id: 9, category: "A", weight: 80
id: 2, category: "C", weight: 70
id: 5, category: "B", weight: 50

If you set distinct values are limited to to 1 for the category attribute, the strategy returns the following recommended items:

id: 1, category: "A", weight: 100
id: 4, category: "B", weight: 90
id: 2, category: "C", weight: 70

String

Number

exists

The rule evaluates to true if the attribute exists.

The attribute exists if the platform has tracked at least one value for the attribute.

Do not define a target value.

Array of Booleans

Array of numbers

Array of strings

Boolean

Number

String

does not exist

The rule evaluates to true if the attribute does not exist.

The attribute does not exist if the platform has not tracked any values for the attribute.

Do not define a target value.

Array of Booleans

Array of numbers

Array of strings

Boolean

Number

String

matches regular expression

The rule evaluates to true if the attribute value matches the defined regular expression.

Rule: <name> matches regular expression "^[Aa]\w+s$"

name: "Aliens" -> TRUE
name: "ALIENS" -> FALSE

Define the regular expression using the RE2 syntax.

String

String

does not match regular expression

The rule evaluates to true if the attribute value does not match the defined regular expression.

Rule: <name> does not match regular expression "^[Aa]\w+s$"

name: "Aliens" -> FALSE
name: "ALIENS" -> TRUE

Define the regular expression using the RE2 syntax.

String

String

Filter examples

Here are some examples showing how to create filters with different operators and how those filters get evaluated.

Filter examples: equals, greater than, less than

Return all items from the category "Books"
Return all items from the category 'Books'
Figure: Return all items from the category 'Books'
Filter evaluation examples
type: "Books" -> TRUE
type: "BOOKS" -> TRUE
type: "books" -> TRUE
type: "Book" -> FALSE
type: "Magazines" -> FALSE
Return all items from the category "Books", except ones from a specific company
Return all items from the category 'Books', except ones from a specific company
Figure: Return all items from the category 'Books', except ones from a specific company
Filter evaluation examples
type: "Books", company: "Random House" -> TRUE
type: "Books", company: "Vanity Press" -> FALSE
type: "Magazines", company: "Random House" -> FALSE
Return books that cost less than 30 currency
Return books that cost less than 30 currency
Figure: Return books that cost less than 30 currency
Filter evaluation examples
type: "Books", price: 29.99 -> TRUE
type: "Books", price: 39.99 -> FALSE
type: "Magazines", price: 19.99 -> FALSE

Filter examples: contains, begins with, ends with

Return items whose name contains "cheetah"
Return items whose name contains 'cheetah'
Figure: Return items whose name contains 'cheetah'
Filter evaluation examples
name: "Cheetah Plushy" -> TRUE
name: "Living with cheetahs, as told by a cheetah lover" -> TRUE
name: "Operation C.H.E.E.T.A.H." -> FALSE
Return items whose name does not contain "cheetah"
Return items whose name does not contain 'cheetah'
Figure: Return items whose name does not contain 'cheetah'
Filter evaluation examples
name: "Cheetah Plushy" -> FALSE
name: "Living with cheetahs, as told by a cheetah lover" -> FALSE
name: "Operation C.H.E.E.T.A.H." -> TRUE
Return movies whose name starts with "A"
Return movies whose name starts with 'A'
Figure: Return movies whose name starts with 'A'
Filter evaluation examples
type: "Movies", name: "Aliens" -> TRUE
type: "Movies", name: "aliens" -> TRUE
type: "Movies", name: "Tenet" -> FALSE
type: "Movie", name: "Argo" -> FALSE
Return movies whose name starts with "A", "B", or "C"
Return movies whose name starts with 'A', 'B', or 'C'
Figure: Return movies whose name starts with 'A', 'B', or 'C'
Filter evaluation examples
type: "Movies", name: "Aliens" -> TRUE
type: "Movies", name: "aliens" -> TRUE
type: "Movies", name: "Tenet" -> FALSE
type: "Movies", name: "Babe" -> TRUE
type: "Movie", name: "A Clockwork Orange" -> FALSE
Return books whose title ends with "for dummies" and that cost less than 30 currency
Return books whose title ends with 'for dummies' and that cost less than 30 currency
Figure: Return books whose title ends with 'for dummies' and that cost less than 30 currency
Filter evaluation examples
type: "Books", name: "JavaScript For Dummies", price: 29.99 -> TRUE
type: "Books", name: "Windows 10 For Dummies", price: 39.99 -> FALSE
type: "Books", name: "The Complete Idiot's Guide to JavaScript", price: 19.99 -> FALSE

Filter examples: is one of

Return hotels located in Cairo, Kochi, or La Paz
Return hotels located in Cairo, Kochi, or La Paz
Figure: Return hotels located in Cairo, Kochi, or La Paz
Filter evaluation examples
type: "Hotel", city: "Cairo" -> TRUE
type: "Hotels", city: "Kochi" -> TRUE
type: "Hotels", city: "LaPaz" -> FALSE
Return beach volleyball events in Finland, except those in Tampere and Turku
Return beach volleyball events in Finland, except those in Tampere and Turku
Figure: Return beach volleyball events in Finland, except those in Tampere and Turku
Filter evaluation examples
mainCategory: "Beach Volleyball", country: "Finland", city: "Helsinki" -> TRUE
mainCategory: "Beach Volleyball", country: "Finland", city: "Tampere" -> FALSE
mainCategory: "BVB", country: "Finland", city: "Turuku" -> TRUE

Filter examples: includes, any one of contains/begins with/ends with

Return any item one whose categories is "slots"
Return any item one whose categories is 'slots'
Figure: Return any item one whose categories is 'slots'
Filter evaluation examples
categories: ["jackpot", "slots"] -> TRUE
categories: ["jackpot", "slot"] -> FALSE
categories: ["poker", "stud"] -> FALSE
Return any item one whose categories contains "jack"
Return any item one whose categories contains 'jack'
Figure: Return any item one whose categories contains 'jack'
Filter evaluation examples
categories: ["jackpot", "slots"] -> TRUE
categories: ["JACKPOT", "slot"] -> TRUE
categories: ["blackjack", "cards"] -> TRUE
Return any item one whose categories starts with "slot"
Return any item one whose categories starts with 'slot'
Figure: Return any item one whose categories starts with 'slot'
Filter evaluation examples
categories: ["jackpot", "slots"] -> TRUE
categories: ["jackpot", "slot"] -> TRUE
categories: ["poker", "stud"] -> FALSE

Filter examples: during

Return items that have been created in the past 24 hours
Return items that have been created in the past 24 hours
Figure: Return items that have been created in the past 24 hours
Filter evaluation examples
If the current time is: 2022-01-20 18:00:00 UTC+2

created_at: "2022-01-19T09:53:31+02:00" -> FALSE
created_at: "2022-01-20T13:23:03+02:00" -> TRUE
Return items that have not been updated in the past 30 days
Return items that have not been updated in the past week
Figure: Return items that have not been updated in the past week
Filter evaluation examples
If the current time is: 2022-01-20 18:00:00 UTC+2

updated_at: "2021-11-11T00:03:54+02:00" -> TRUE
updated_at: "2022-01-20T14:52:16+02:00" -> FALSE

Filter examples: exists

Return items without a name (either the name attribute is missing or the attribute has an empty value)
Return items without a name
Figure: Return items without a name
Filter evaluation examples
("name" attribute not found) -> TRUE
name: undefined -> TRUE
name: null -> TRUE
name: "" -> TRUE
name: "Aliens" -> FALSE

Filter examples: regular expressions

info

The platform supports the RE2 syntax for regular expressions.

Return movies whose name starts with "A" or "a" and ends in "s"
Return movies whose name starts with 'A' or 'a' and ends in 's'
Figure: Return movies whose name starts with 'A' or 'a' and ends in 's'
Filter evaluation examples
type: "Movies", name: "Aliens" -> TRUE
type: "Movies", name: "aliens" -> TRUE
type: "Movies", name: "ALIENS" -> FALSE
type: "Movies", name: "Alien" -> FALSE