Recommendations enable you to automatically display the most relevant items to each user. Our machine learning strategies are based on your data feed, user behavior, and general user trends, to calculate decisions based on the strategies you select. The recommendation engine scores each item in your data feed according to your chosen strategy. Depending on your settings, additional filters can be applied to limit the results. Once the list is complete, the items are sorted by score and relevance to the user and context, and the top results are displayed.
Create a recommendation widget
- Go to Site Personalization › Create Campaign › Recommendations
- Enter a name, and optionally, add notes and labels.
- Specify the campaign settings such as page type, insertion method, and advanced settings. See the recommendation campaign settings section for more information.
- Configure the targeting settings of the experience to determine when, where, and to whom the experience is displayed.
- Create variations using templates, based on other experiences, or by using a data feed.
- Template: When creating a new recommendation widget variation, you can create a custom HTML template or select one of the Dynamic Yield out-of-the box templates.
- Design: The variable tab provides customization possibilities such as the widget’s number of items and their attributes (title, length, price). It also includes the widget’s recommendation strategy.
The strategy dropdown menu is populated with relevant strategies based on the previously defined Page Type. The menu icon provides additional options to include: Creating a new strategy, editing an existing one, or duplicating a strategy for tweaking and saving as new. Learn more about Recommendation Strategies.
Note: The preview pane does not reflect the chosen strategy.
- When you are done with each variation, click Save Variation.
- Set the allocation, primary metric, and advanced experience settings.
- Configure how much of your traffic to allocate to each variation to the control group.
- Click Save Experience.
- Click the plus icon
to create an additional targeted experience.
- To see what the campaign looks like, click Preview. Click Save and Publish when everything is to your liking.
- To track the performance of your recommendations, click the report icon
next to the campaign name.
Add recommendations to various campaign types
You can add recommendations into different Dynamic Yield campaigns, such as overlays, and notifications. Create a specialized template, and use it when creating the campaign. To add recommendations to an email campaign, see Experience Email.
To create the template:
- Go to Assets › Templates and click Add New.
- Select the template type, and select Enable product recommendations.
- Create the template using HTML, CSS, and JavaScript.
- To display a recommendation, insert the following code into the HTML tab:
${#Recommendation} <a class="rec_item" href="${url}"> <img src="${Image}" /></a> <div class="rec_name">${Name}</div> ${/Recommendation}
The Recommendation tag wraps the HTML of the single item design. To display the relevant image, product, post name, or any other property, set the variable type to Feed Property, and then select the corresponding property (see image).
When you add this tag to your HTML, a new variable – Recommendation Strategy – appears in the Variables tab. This variable lets you select the recommendation algorithm and the number of items to present in the recommendation.
- Save the template.
- To use the template, select it from the My Templates tab when creating a variation.
Recommendation campaign settings
When you create a recommendation campaign, you specify settings including page type, insertion method, and other advanced settings. This section contains details about these settings.
Page type
This setting determines the page type the recommendation is placed on. Select Any Page if none of the options fit your use case.
Note that after you select a page type and save the campaign, you can no longer change the page type. If necessary, duplicate the campaign or create a new one.
Location
Recommendations can be inserted and placed onto any page of your website using the following methods:
- Replace Element: Dynamic Yield will render the Recommendation, replacing an existing element on your site with no need for you to apply technical or IT resources. You specify the element to replace as a CSS Selector.
- Add After Element: The same as replace element, but the element is placed just after a specific CSS selector.
- Add Before Element: The same as replace element, but the element is placed just before a specific CSS selector.
- Embed with Code: Implement a Recommendation directly into your website’s source code (Dynamic Yield will not render it). After publishing the campaign, hover over the campaign name and click on the code icon to locate the code.
For the first three options, you also specify on which pages Dynamic Yield should render the campaign.
Advanced settings
- Fire Google Analytics Event: Only visible if the Google Analytics integration is enabled. This option is enabled by default, but you can disable it to prevent reporting data to Google Analytics about a specific recommendation.
- Execute custom integrations: Fire custom JavaScript code when a variation is served. Custom integrations are managed in the Integration screen under Settings. This option is only visible if a custom integration is enabled.
- Serve on Every SPA Event: Relevant for single page applications that don’t generate a browser refresh with every change of screen. If you need the recommendation to relaunch or reevaluate its targeting conditions upon each screen change in your single-page application, fire a track_pageview event and enable this option. For more information on working with single page applications, see Dynamic Yield for Single-Page Applications.
- Optimize Site Loading Time: Stores the experience offsite to maximize overall site loading speed. Recommended primarily for experiences below the fold to reduce the risk of flicker.
- Wait for Element: Prevent rendering the recommendation until an element has loaded or a condition has been met. Used primarily for troubleshooting purposes or to ensure that Google Analytics is tracking the recommendation properly. Select one of the following options, or use the + and option to specify more than one element to wait for:
-
- None (default): Do not wait for anything before rendering the recommendation.
- CSS Selector: Wait for an element to load on the page defined as a CSS Selector.
- JQuery Library: Wait for the JQuery library to load.
- Google Analytics (classic): Wait for Google Analytics (classic) to load.
- Google Analytics (universal): Wait for Google Analytics (classic) to load.
- Dynamic Yield Data: Wait for Dynamic Yield data (such as social proof metrics) to load.
- External Component: Wait for any custom-defined JavaScript function to load on the page.
Preventing recommendation duplication
If more than one recommendation widget exists on a single page, Dynamic Yield automatically prevents the same results from displaying in more than one widget, as follows:
- Dynamic Yield evaluates all recommendation strategies requested on the page.
- Recommendation strategy requests are consolidated into a single request and sent to the recommendations engine.
- Strategy requests are calculated one by one by the recommendations engine. As results are returned, they are automatically excluded from subsequent strategy results.
- Recommendations results are returned and rendered by Dynamic Yield.
In the following cases, recommendation results are not excluded even if they were returned in previous strategy results:
- Activity-based recommendations, such as recently viewed products or recently purchased products.
- Products pinned to specific slots using filtering rules.
This process applies for recommendation that are rendered by Dynamic Yield. If you are manually rendering recommendations using the recommendationWidgetData API, you can use the exclude parameter to limit the results of each recommendation widget to prevent duplication.