How to build a shopping wizard

This page describes how a shopping wizard application can be built on top of Froomle’s recommendations API.

Application flow

A shopping wizard is an interactive application that suggests products based on user preference and feedback. It is the perfect tool for users who need some guidance finding the right product. For this guide we will assume the application we are building functions as follows:

  • The user sets some criteria for the product they are looking for, such as the product category and maximum amount they are willing to spend.

  • The application presents the user with a varied selection of products that meet these criteria.

  • Clicking on the "like" button of a recommended product updates the list of suggestions to show more products similar to that one.

  • Once a suitable product is found, the user adds it to their shopping cart.

In this guide we will show how to generate these product suggestions using our recommendations API and how to incorporate user preferences and feedback.

Initial suggestions

Suppose the user is looking for video games and board games that cost between 20 and 100 euros. The recommendation request to produce the initial list of suggestions could then look as follows:

  • Recommendation request

  • Recommendation response

  • Configuration

{
  "page_type": "shopping_wizard",
  "channel": "www-desktop",
  "device_id": "BD3qoN3ko7URdparQX2vDT4",
  "user_id": "7081599607",
  "lists": [
    {
      "configuration_id": "shopping_wizard_config",
      "list_name": "discover",
      "list_size": 10,
      "category": ["Video Games", "Board Games"],
      "price_min": 20,
      "price_max": 100
    }
  ]
}
{
  ...
  "lists": [
    {
      "list_key": "sdjfkls12nfdls",
      "list_name": "discover",
      "configuration_id": "shopping_wizard_config",
      "list_size" : 10,
      "items" : [
        {
          "rank": 1,
          "product" : "948451",
        },
        {
          "rank": 2,
          "product" : "643321"
        },
        ...
      ]
    },
    ...
  ]
}
{
  "configuration_id": "shopping_wizard_config",
  "constraints": [
    {
      "query": {
        "key": "category",
        "match": {
          "or": {
            "variable": {
              "name": "category",
              "on_absent_drop": true
            }
          }
        }
      }
    },
    {
      "query": {
        "key": "price",
        "gte": {
          "variable": {
            "name": "price_min",
            "on_absent_drop": true
          }
        }
      }
    },
    {
      "query": {
        "key": "price",
        "lte": {
          "variable": {
            "name": "price_max",
            "on_absent_drop": true
          }
        }
      }
    }
  ]
}

Here the "shopping_wizard_config" configuration will limit recommendations to products where the price metadata field is between the supplied "price_min" and "price_max" values, and category is one of the supplied product categories.

Additional suggestions

To show more suggestions the application needs to keep track of products the user has already seen so they are not shown twice. They can be excluded from Froomle’s recommendations by adding them to "histories" and setting the "reconsumable" flag to False:

{
  "page_type": "shopping_wizard",
  "channel": "www-desktop",
  "device_id": "BD3qoN3ko7URdparQX2vDT4",
  "user_id": "7081599607",
  "lists": [
    {
      "configuration_id": "shopping_wizard_config",
      "list_name": "discover",
      "list_size": 10,
      "category": ["Video Games", "Board Games"],
      "price_min": 20,
      "price_max": 100
    }
  ],
  "histories": {
    "impressions": [ {
        "id": "948451",
        "reconsumable": False
    },
    ...
  }
}

User feedback

Your application might have some way to gather feedback on the suggested products, for example a "like" button, or an option to show products that are similar to a suggested product. You can add these products of interest to a "histories" list so our recommendation engine can recommend similar products:

{
  "page_type": "shopping_wizard",
  "channel": "www-desktop",
  "device_id": "BD3qoN3ko7URdparQX2vDT4",
  "user_id": "7081599607",
  "lists": [
    {
      "configuration_id": "shopping_wizard_config",
      "list_name": "more_like_this",
      "list_size": 10,
      "category": ["Video Games", "Board Games"],
      "price_min": 20,
      "price_max": 100
    }
  ],
  "histories": {
    "likes": [ {
        "id": "643321"
    },
    ...
    ],
    "impressions": [ {
        "id": "948451",
        "reconsumable": False
    },
    ...
    ]
  }
}

Our engine can incorporate these likes into the recommendations in a variety of ways. It can give a subtle bias towards these products, recommend exclusively products that are highly similar, or anything in between. Please contact your solutions architect to discuss your specific needs.