Skip to main content

Adding filters to a recommendation

note

This example assumes that your site has a basic feature setup in place.

This use case example shows you how to use filters to refine the results of an existing recommendation.

In this example, you:

  • Duplicate a recommendation strategy, and add one filter to the new strategy. The strategy defines the logic and settings for generating the recommendation data.

  • Set an existing recommendation modification to use the new strategy. The modification retrieves the recommendation data generated from the strategy and displays the final recommendation.

You work on the recommendation strategy and modification in the Frosmo Control Panel.

note

Consider the assumptions and screenshots in this example as just that: examples. In working through the example, feel free to adjust the assumptions to fit your site and needs.

tip

If you do not want this example to interfere with the live content on your site, duplicate the existing recommendation modification, and use the new modification in test mode.

Choose the correct example for your site:

iGaming

For example purposes, let's assume the following:

  • You want to edit the Home page - Recommendation 1 modification on an iGaming site. The modification has two variations, but you only want to edit the first one, which uses the Most viewed on site (24 hours) (no affinity) strategy.

  • You want to only recommend items that are part of a Halloween campaign. These items have the value Halloween in their product attribute themes (an array of strings). You therefore update the strategy with a filter that only returns items whose themes attribute contains the value Halloween.

The following figure shows what the final recommendation might look like before and after applying the filter.

Recommendation before and after filtering by availability
Figure: Recommendation before and after filtering by availability

To work through the example:

  1. Duplicate the recommendation strategy, and add the filter to the new strategy.

  2. Set the recommendation modification to use the new strategy.

Duplicating the recommendation strategy

To duplicate the recommendation strategy:

  1. Log in to the Frosmo Control Panel, and select your site.

  2. In the sidebar, select More > Recommendations.

  3. In the recommendation strategies list, find the strategy you want to duplicate, click the quick menu button for the strategy, and select Duplicate. In this example, the strategy is Most viewed on site (24 hours) (no affinity).

    Duplicating the recommendation strategy

    The Control Panel creates a duplicate strategy with the exact same settings as the original and opens the edit view for the strategy.

  4. Edit the following settings:

    • Name: Enter "Most viewed Halloween items on site (24 hours) (no affinity)".

    • Filters: Add a filter for only including Halloween items:

      1. Click Add filter. The filter settings open.

      2. In the Name field, enter "Include Halloween items".

      3. In the existing empty rule, select themes as the item attribute for filtering items. The field automatically lists the item attributes tracked for the site.

        Filter settings for the recommendation strategy
      4. Select any one of contains as the operator for comparing the item attribute value to the target value.

        Filter settings for the recommendation strategy
      5. Select Halloween as the target value for the comparison. The field automatically lists the different values tracked for the themes attribute.

        Filter settings for the recommendation strategy
      6. Click Save.

    The following figure shows the complete recommendation strategy in the Control Panel. Click the figure to view a larger version.

    Recommendation strategy settings

    For more information about the settings, see the recommendation user guide.

  5. Click Save. The Frosmo Platform generates the recommendation data for the new strategy. The data generation may take several minutes.

  6. Optionally, in the Preview section, review the items returned by the strategy.

  7. To exit the strategy settings, click Close.

You have duplicated the recommendation strategy. You can now use the new strategy in a modification.

Using the new recommendation strategy

To use the new strategy in the recommendation modification:

  1. In the Control Panel, in the sidebar, select Modifications.

  2. In the modifications list, find the modification you want to edit, and click the modification name. In this example, the modification is Home page - Recommendation 1.

  3. Update the modification content to use the new strategy:

    1. In the Basic settings view, in the Content section, click the variation in which you want to use the new strategy. In this example, the variation is the first one.

      Updating the modification content to use the new recommendation strategy
    2. Optionally, in the Variation settings section, change the Title to "Most viewed Halloween items on site (24 hours) (no affinity)" to reflect the new strategy.

    3. In the Content options section, select the new strategy. In this example, the strategy is Most viewed Halloween items on site (24 hours) (no affinity).

      Updating the modification content to use the new recommendation strategy
    4. At the bottom of the view, click Save. The variation now uses the new strategy.

    For more information about the settings, see the modification user guide.

  4. To exit the modification settings, click Close.

You have set the recommendation modification to use the new strategy. The updated variation now displays a recommendation that only includes items that are part of the Halloween campaign.

You're all done with this example!

Retail

For example purposes, let's assume the following:

  • You want to edit the Home page - Recommendation 1 modification on a retail site. The modification has two variations, but you only want to edit the first one, which uses the Most viewed on site (24 hours) (no affinity) strategy.

  • You want to only recommend items that are in stock. You therefore update the strategy with a filter that only returns items whose availability attribute has the value In stock.

The following figure shows what the final recommendation might look like before and after applying the filter.

Recommendation before and after filtering by availability
Figure: Recommendation before and after filtering by availability

To work through the example:

  1. Duplicate the recommendation strategy, and add the filter to the new strategy.

  2. Set the recommendation modification to use the new strategy.

Duplicating the recommendation strategy

To duplicate the recommendation strategy:

  1. Log in to the Frosmo Control Panel, and select your site.

  2. In the sidebar, select More > Recommendations.

  3. In the recommendation strategies list, find the strategy you want to duplicate, click the quick menu button for the strategy, and select Duplicate. In this example, the strategy is Most viewed on site (24 hours) (no affinity).

    Duplicating the recommendation strategy

    The Control Panel creates a duplicate strategy with the exact same settings as the original and opens the edit view for the strategy.

  4. Edit the following settings:

    • Name: Enter "Most viewed in-stock items on site (24 hours) (no affinity)".

    • Filters: Add a filter for only including in-stock items:

      1. Click Add filter. The filter settings open.

      2. In the Name field, enter "Include in-stock items".

      3. In the existing empty rule, select availability as the item attribute for filtering items. The field automatically lists the item attributes tracked for the site.

        Filter settings for the recommendation strategy
      4. Select equals as the operator for comparing the item attribute value to the target value.

        Filter settings for the recommendation strategy
      5. Select In stock as the target value for the comparison. The field automatically lists the different values tracked for the availability attribute.

        Filter settings for the recommendation strategy
      6. Click Save.

    The following figure shows the complete recommendation strategy in the Control Panel. Click the figure to view a larger version.

    Recommendation strategy settings

    For more information about the settings, see the recommendation user guide.

  5. Click Save. The Frosmo Platform generates the recommendation data for the new strategy. The data generation may take several minutes.

  6. Optionally, in the Preview section, review the items returned by the strategy.

  7. To exit the strategy settings, click Close.

You have duplicated the recommendation strategy. You can now use the new strategy in a modification.

Using the new recommendation strategy

To use the new strategy in the recommendation modification:

  1. In the Control Panel, in the sidebar, select Modifications.

  2. In the modifications list, find the modification you want to edit, and click the modification name. In this example, the modification is Home page - Recommendation 1.

  3. Update the modification content to use the new strategy:

    1. In the Basic settings view, in the Content section, click the variation in which you want to use the new strategy. In this example, the variation is the first one.

      Updating the modification content to use the new recommendation strategy
    2. Optionally, in the Variation settings section, change the Title to "Most viewed in-stock items on site (24 hours) (no affinity)" to reflect the new strategy.

    3. In the Content options section, select the new strategy. In this example, the strategy is Most viewed in-stock items on site (24 hours) (no affinity).

      Updating the modification content to use the new recommendation strategy
    4. At the bottom of the view, click Save. The variation now uses the new strategy.

    For more information about the settings, see the modification user guide.

  4. To exit the modification settings, click Close.

You have set the recommendation modification to use the new strategy. The updated variation now displays a recommendation that only includes items that are in stock.

You're all done with this example!