
You can add recommendations to: 
- emails,
- web push notifications,
- in-app messages, 
- mobile push notifications,
- the website,
- a mobile application

## Methods of displaying recommendations

You can decide which method you want to use to display the recommendations:

### API

See [Recommendations API](/developers/api/recommendations) in the Developer Guide.

### Mobile SDK

See [Displaying AI recommendations with documents and screen views](/developers/mobile-sdk/displaying-recommendations/documents) in the mobile SDK documentation.

### Using recommendations in communication templates
You can display recommendations by referencing the ID of the recommendation through [Jinjava tags](/developers/inserts/recommendations-v2), it's most common to [use it in templates of messages](#embedding-a-recommendation-in-templates) to your customers such as email or dynamic content (which lets you display recommendations on your website).

## Requirements
---
You must [create a recommendation](/docs/ai-hub/recommendations-v2/creating-recommendation-campaign) before.

## Distributing recommendations in Experience Hub
---

You can display recommendations to your customers on your website through [dynamic content](/docs/campaign/dynamiccontent). Also, you can incorporate recommendations into various types of messages such as emails, web push and mobile push notifications, in-app messages. It can be done by [embedding a recommendation inserts in the message templates](#embedding-a-recommendation-in-templates). 


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

You can read more about recommendation inserts in [Inserting recommendations](/developers/inserts/recommendations-v2).

</div></div></div>


### Embedding a recommendation in templates
---

This section presents how to insert a recommendation in the templates of the following content types:

- dynamic content,
- email,
- in-app messages
- mobile push notifications
- web push notifications

You can insert the recommendation in the following ways:
- [insert a code with a recommendation into the template](#insert-recommendation-code)
- [add a variable that allows users to select a recommendation](#add-a-selector-with-recommendations) from the dropdown list in a Config tab while editing the template

#### Insert recommendation code

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/experience-hub-icon.svg" alt="Campaign icon" class="icon" > **Experience Hub**
2. Select a communication type:  
    - Dynamic content
    - Email
    - In-app messages
    - Mobile Push
    - Web Push
2. On the left pane, select **Templates**.
3. In the upper right corner, click **New template**.  
4. If you selected Mobile Push, after clicking **New template**, you must select the notification type:  
    - **Simple push** - Appear in the notification center when the screen is locked or they are visible in the top bar when the screen is unlocked. 
    - **Silent push** - A hidden notification that is delivered to the app on a user's device.
4. If you selected dynamic content, email, in-app message or a mobile push as a communication type, select **Code editor**. 
    If you selected web push, you will be redirected automatically to the template editor. 
3. At the top of the view, click **Inserts**.
4. Select one of the categories: **AI Cart Recommendations** (for the Cart recommendation model) or **AI Suite** (for the remaining recommendation model types).
5. Click the name of the recommendation.  
    **Result**: You get a code of the recommendation.
6. Click **Get HTML code**.
7. If necessary, you can make changes to the HTML code.
8. Click **Copy to clipboard**.
9. Close the HTML preview of the code.
10. Paste the code into the HTML editor.  
    **Result**: 

    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/campaign/_gfx/recommendation-distribution.png" alt="Recommendation distribution" class="full">
    <figcaption> HTML code of the recommendation in an email template </figcaption>
    </figure>


   <div class="admonition admonition-tip"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   You can incorporate the recommendation in various communication channels or documents in the same way using [Inserts](/developers/inserts/recommendations-v2).

   </div></div></div>



#### Add a selector with recommendations

To make editing simple for non-programmer users, you can create a variable in the template. It will be available in the **Config** tab as a dropdown list with all recommendations available in the workspace.  


<div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This option is not available for web push notifications.

</div></div></div>



1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/experience-hub-icon.svg" alt="Campaign icon" class="icon" > **Experience Hub**
2. Select a communication type:
    - Dynamic content
    - Email
    - In-app messages
    - Mobile Push

2. On the left pane, select **Templates**.
3. In the upper right corner, click **New template**.
4. If you selected Mobile Push, after clicking **New template**, you must select the notification type:  
    - **Simple push** - Appear in the notification center when the screen is locked or they are visible in the top bar when the screen is unlocked. 
    - **Silent push** - A hidden notification that is delivered to the app on a user's device.
4. Select **Code editor**.  
5. Select one of the following tabs: HTML, CSS, JavaScript, JSON (available only for mobile push notification templates).
6. In the upper-right corner, click **Variable**.  
    **Result**: On the left side, a sidebar appears.
7. In the **Identifier** field, enter the ID of the variable.  
    The first character of the ID can't be a number.
8. From the **Type** dropdown list, select **Synerise insert select**.
9. Optionally, fill the **Label** (which is the name of the field in the configuration form) and the **Description** (which is the description of the field in the configuration form) fields.
10. From the **Insert Type** dropdown list, select **AI Recommendations**. 
11. At the top of the sidebar, click **Add**.  
    **Result**: In the **Config** tab, a selector with recommendations appears.

    <figure>
    <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/campaign/_gfx/add-variable-reco.png" alt="Recommendation list" class="full">
    <figcaption>The list of recommendations in the Config tab </figcaption>
    </figure>


