Once you have created your recommendation scheme, you can use it in a messaging template. When a campaign that uses the template runs, it applies the recommendation steps for every user in the segment to deliver a personalized message with items tailored to each user.

Include recommendations in your template

Before you can include recommendations in your template, you must create a recommendation scheme.

To include recommendations in your template:

  • Include the recommendation scheme from the Data tab of your template. If you are creating a Live Content template, go to the Template Info tab.
  • Select the right Preview User for the template.

Use item recommendations in your messages

The method for including recommendations in the template content differs based on the type of messaging template.

  • Drag and drop an AI+ Items block while using the Visual Studio to design an email template or in-app template.
  • Manually add the Liquid expression in the template.

Include recommendations using Visual Studio

If you are creating an email template or an in-app template using the Visual Studio, you can drag and drop an AI+ Items block to include recommendations.

To include recommendations in your template:

  • From the Visual Studio Content tab, drag and drop the AI+ Items block into the required position in the template.

    Dragging the AI+ Items block into a template in the Visual Studio.

  • Click Configure Item Recommendations in the added block.
  • Click Create.
  • Navigate to the Data tab to preview the recommendations for the selected preview user.

    Data tab showing recommendation preview for the selected user.

Configure item recommendations

To update the look and feel of the recommended content, configure the AI+ Items recommendations component.

  • Select the AI+ Items block and click Configure Item Recommendations.

    Configure Item Recommendations button on the AI+ Items block.

  • Configure the recommendations component.
  • Configure the Block Layout.
    • Select the recommendation block to use.
    • Set the Maximum items to show in the block.
    • Set the starting index for the items. For example, to include items from the beginning of the block, set to 0. To exclude the first item in the block, set to 1.
    • Set the number of lines of text to show.
    • If an image is to be included, set the position of the image in the block.
    • Decide if a CTA button is to be included.
  • If you selected to include an image, configure the Image Settings. You can use a product attribute for the settings or include a custom value.
    • Set the Image Source.
    • Set a link for the image.
  • Configure the content for the Lines. You can use a product attribute for the settings or include a custom value.

    For example, you can set Line 1 to show the product title, Line 2 to show the price, and Line 3 to show the author, the brand name, or the size of the item.

  • If you selected to include a CTA button, configure the settings for the button.
  • Set the text color and CTA button color.
    • Use the color Picker option and select a color.
    • Use the Custom option and dynamically define the color using personalization. For example, you can set the line color to {{user.preferred_color}}.
  • Click Update.

Include recommendations manually

In some studios, such as the HTML Editor, the Liquid strings used to reference different components of a recommendation scheme are available through an autocomplete menu. To activate the autocomplete menu, add the opening and closing double curly brackets for the Liquid expression and click between them.

In other studios, you must manually type the Liquid expression in the template.

  Tip

Copy and paste the syntax from the HTML Email editor to avoid guesswork and errors.

Components of a recommendation scheme

You can include a recommendation scheme in a messaging template by using the open-source templating language Liquid. Understanding the components of a recommendation block ensures that you include the right information in the messaging template.

Recommendation scheme showing blocks, products, and attributes.

  • A recommendation scheme contains one or more recommendation blocks.
  • Each recommendation block has a name.
  • The products in a block are numbered from left to right, starting at 0. So the first product in the block is product[0], the second product is product[1], and so on.
  • Each product has attributes that you can include in the template. For example, a book has the attributes title, price, author, and so on.

Format of recommendation data in a template

You can view the recommendation data in the template from the Data tab. If you are creating a Live Content template, go to the Template Info tab instead.

The data depends on the selected preview user.

Data tab showing recommendation data in JSON format.

Liquid expression to include an item

Combine the block name, product index, and attribute to form a Liquid expression that references a recommended item in the template. Liquid expressions are enclosed in double curly brackets.

{{recommendations.<block_name>.products[<product_number>].<product_attribute>}}

For example, consider a recommendation block named abandoned_cart_items:

  • To include the title of the first product, the expression is:

    {{recommendations.abandoned_cart_items.products[0].title}}

  • To include the price of the product:

    {{recommendations.abandoned_cart_items.products[0].price}}

  • To include an image, use an <img> tag:

    <img src="{{recommendations.abandoned_cart_items.products[0].image}}" />

Here is an example of a Push template where the recommendation is created through the autocomplete menu:

Push template showing recommendation Liquid expression via autocomplete.

Here is an example of an SMS template where the recommendation for a book is entered manually:

SMS template showing manually entered recommendation Liquid expression.

  What's next

Once your recommendations are live, see Measure performance to track how your recommendation schemes are performing.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.