Example: Recommending the most popular items based on visitor affinity
This example shows you how to create a recommendation for the most popular items in the past 7 days based on visitor affinity. The recommendation comes in two competing variations that each use a different level of affinity for sorting the recommendation results. This allows you to test which level of affinity performs better over time. The example assumes that the site already has the necessary recommendation template and placement set up and ready to use, so you'll only be creating the strategies and modification for the recommendation.
In this example, you:
-
Create two recommendation strategies for the top 10 most popular items on the site based on visitor affinity. The most popular items comprise (a) the top 5 most viewed items on the site in the past 24 hours and (b) the top 5 most purchased items on the site in the past 7 days. The two strategies differ only in that one uses 50% affinity, while the other uses 100% affinity. The strategies do not use fixed items or filters.
-
Create a modification for displaying the recommendation on the site home page. The modification is a multi-armed bandit modification with 2 variations, one for each strategy. The variations use a recommendation slider template that includes a strategy selector.
You create the recommendation strategies and modification in the Frosmo Control Panel.
The following figure shows an example of the final recommendation on the home page. The set of recommended items is different for each visitor based on their specific affinities.
For generating the recommendation, this example relies on product data and transaction data collected from the site. The example therefore assumes that product and transaction tracking are correctly set up on the site.
If you're trying out this example on a production site, but do not want the example to interfere with production content, use either test mode or a workspace in creating the example. You can also safely preview the modification from the Control Panel.
To create the recommendation:
Creating the recommendation strategies
Both recommendation strategies return up to 5 items most often viewed on the site in the past 24 hours and up to 5 items most often purchased on the site in the past 7 days. The strategies sort the items based on visitor affinity. The strategies do not define fixed items or filters.
To create the first recommendation strategy:
-
In the Frosmo Control Panel, in the sidebar, select More > Recommendations.
-
Click Create recommendation strategy.
-
Define the following settings:
-
Name: Enter "Most popular on site with half affinity". Note that the ID automatically completes to "most-popular-on-site-with-half-affinity".
-
Page type: Select Home.
-
Algorithms: Select the following algorithms (in order):
-
Most viewed on the site in the past 24 hours, 5 items
-
Most bought on the site in recent days, 5 items
-
-
Sorting: Select Affinity, and set the slider to half-way (50%). This means that a visitor's affinity for an item counts for 50% of the item's final recommendation ranking. The algorithm determines the other 50%.
The following figure shows the complete recommendation strategy in the Control Panel. Click the figure to view a larger version.
For more information about the settings, see Creating and editing a recommendation strategy.
-
-
Click Save. The Frosmo Platform generates the recommendation data for the new strategy. The data generation may take several minutes.
-
Optionally, in the Preview section, review the items returned by the strategy. By default, the preview shows the recommendation results without any affinity applied. To show the results with affinity applied, enter a Visitor ID.
To create the second recommendation strategy, repeat the above steps, but:
-
Enter "Most popular on site with full affinity" as the name.
-
Set the affinity slider to full affinity applied (100%). This means that a visitor's affinity for an item counts for 100% of the item's final recommendation ranking. The strategy ignores how the algorithm ranks the item.
You have created the recommendation strategies. You can now use their recommendation data in a modification.
Creating the recommendation modification
For example purposes, let's assume you have the following predefined in the Control Panel:
-
Placement for a home page recommendation
-
Template for a recommendation slider with two content options: title and recommendation strategy selector
To create and activate the recommendation modification:
-
In the Control Panel, in the sidebar, select Modifications.
-
Click Create modification.
-
Enter "Home page - Recommendation - Most popular for visitor" as the modification name, select Multi-armed bandit as the modification case, select Recommendation as the content type of the modification, and click Create.
For more information about the settings, see Creating and editing a modification.
-
Select the placement for the modification:
-
In the Basic settings view, in the Placement section, click Select placement.
-
Select the predefined placement for a home page recommendation. In this example, the placement is Home page - Recommendation 1.
-
Click Save.
For more information about the settings, see Defining the placement for a modification.
-
-
Define the content for the modification:
-
In the Basic settings view, in the Content section, click Create variation.
-
In the variation settings, for Content source, select Template.
-
In the templates list, select the predefined template for a recommendation slider. In this example, the template is Recommendation slider.
-
In the Content options section, enter an appropriate title for the recommendation, such as "Most popular for you", and select [Home] Most popular on site with half affinity as the recommendation strategy.
-
At the bottom of the view, click Save.
-
Back in the Content section, click the quick menu button for the variation, and select Activate.
-
Repeat the above steps to create the second variation, but select [Home] Most popular on site with full affinity as the recommendation strategy.
-
Back in the Content section, click Define distribution.
-
Select Click as the reward, select Epsilon-greedy or Softmax as the algorithm, and click Save. Both algorithms will always leave some distribution for the losing variation, meaning the variation will always be displayed to some portion of visitors. This allows the losing variation and the winning variation to swap places if the former starts outperforming the latter.
-
Back in the Content section, if you want to disable the comparison group for the modification, click the quick menu button for the group, and select Deactivate.
For more information about the settings, see Defining the content for a modification.
-
-
Activate the modification:
-
At the bottom of the Basic settings view, click Activate.
-
To confirm, click Activate.
-
You have created and activated the modification. The recommendation is now live, and you're done with this example!