---
metadata:
  - name: generator
    content: Diplodoc Platform v5.55.0
alternate:
  - https://yandex.com/support/adfox/en/banners/recommendation-widget.md
  - https://yandex.com/support/adfox/ru/banners/recommendation-widget.md
  - href: en/banners/recommendation-widget.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/adfox/en/llms.txt

# Recommendation widget

The recommendation widget is a content page block that can display ads or host links to your own content across multiple websites. It is available both on the desktop and mobile versions of the site. For more information, see [Recommendation widget](https://yandex.com/support/partner/web/recommendation-widget/about.html?lang=en) in the Yandex Advertising Network Help.

You can use the recommendation widget to set up automatic banner swapping, which lets you: 
- Display your banners instead of recommendations on the selected positions.
- Replace all Yandex Advertising Network ads with your own banners if they have a higher CPM.

## Limits {#limits}

- You can set up the banner for the recommendation widget only in **Dynamic Monetization** campaigns without external monetizers. These parameters are set when [adding a campaign](https://yandex.com/support/adfox/en/campaigns/add-new.md#step1) and can be edited after.

- The **Recommendation widget** banner type isn't displayed in the list of predefined types in the **Settings** tab, but you can see it when creating a placement and adding banners.

- The substitute banner inherits the CSS styles of the Yandex Advertising Network recommendation widget that's linked to the banner's placement.

- [Statistics on recommendations](https://yandex.com/support/partner/web/recommendation-widget/statistics.html?lang=en#statistics) in the partner interface doesn't account for placements via Adfox. You can find these statistics in the Adfox [Reports](https://yandex.com/support/adfox/en/statistics/reports/index.md) section.

## Prepare for banner placement {#preparing}

1. Create a placement with a recommendation widget in one of the following ways:

    {% list tabs %}

    - From the Inventory tab

       1. Go to the **Inventory** tab in the main menu.
       1. Select the site and its section.
       1. Create a placement with the **Recommendation widget** banner type.

    - From the Campaigns tab

       1. Go to the **Campaigns** tab in the main menu.
       1. Select a **Dynamic Monetization** campaign without external monetizers and go to the **Banners** tab.
       1. Click **Create** and select the **Display Advertising** format, the **Predefined** banner type group, and the **Recommendation widget** banner type.

    {% endlist %}

    
1. Open the **Monetization** section and go to the **Recommendation widget** tab.
1. In the **YAN block ID** column, click ![](../_images/add.svg) and select a placement. This will open a recommendation widget builder in the Yandex Advertising Network interface. For more information about parameters in the builder, see [Creating and configuring a widget](https://yandex.com/support/partner/web/recommendation-widget/create.html?lang=en).
    
    {% note info %}
    
    You can't connect a previously created widget, so a new one is created at this step.
    
    {% endnote %}
    
1. Enter the parameters and add an ad unit. It's linked to the site platform after that, and you can create a substitute banner.
1. [Get the ad tag](https://yandex.com/support/adfox/en/ad-inventory/codes/get-code.md) for the recommendation widget from the site or placement level and install it in a container on your site page.

## Place a banner {#adding-banner}

1. Open the **Campaigns** tab in the main menu, select a campaign, and go to the **Banners** tab. 

1. Click **Create**. Add a **Recommendation widget** banner and select the **To replace the cell in the recommendation widget** template.

   ![](../_images/adding-banner-for-replacement.png){style="border: solid 1px #cccccc; max-width=700px"}

1. Fill in the banner parameters with the title, description, advertiser's domain, and other elements to be displayed in the widget. The widget's appearance is [customized](https://yandex.com/support/partner/web/recommendation-widget/html-css.html?lang=en) in the Yandex Advertising Network partner interface.

1. If necessary, add links for banner measurement in third-party ad systems. After adding the banner, navigate to the **Events** tab and paste these links in the **Transition URL** field for the event that you're measuring.

   The following events can be called in the template:

      <!-- source: en/_includes/method-of-counting.md -->
       - **Viewable impression, Yandex (IMS)**: An impression is only counted if at least 50% of the banner area is in the active browser window for at least 2 seconds. [Learn more about viewability counting](https://yandex.com/support/adfox/en/campaigns/impressions-method.md#viewability).
      <!-- endsource: en/_includes/method-of-counting.md -->

      <!-- source: en/_includes/method-of-counting.md -->
       - **Impression (IMS)**: An impression is counted when ad rendering begins.
      <!-- endsource: en/_includes/method-of-counting.md -->

      <!-- source: en/_includes/method-of-counting.md -->
       - **Viewable Impression (IMS)**: An impression is counted according to the criteria set out by international media standards, including the minimum percentage of pixels in the viewable area and the impression duration in the active browser tab. [Learn more about viewability counting](https://yandex.com/support/adfox/en/campaigns/impressions-method.md#viewability).
      <!-- endsource: en/_includes/method-of-counting.md -->

## Set up ad substitution {#placement-settings}

Actions at this stage depend on your goal:

{% list tabs radio %}

- Definitely replace recommendations on specific positions

  In the banner parameters, specify the position number in the widget. The campaign CPM isn't accounted for when selecting banners with the specified position if there's no Yandex Advertising Network ad or a higher-priority banner on it.
    
  If you don't specify the banner position, it becomes a candidate for replacing Yandex Advertising Network ads. This is described in more detail in the next scenario.

  The cell position is calculated from the upper-left corner. In the example below, the third and fourth cells of the recommendation widget are allocated for ads. If the second position is set in the banner parameters, the banner takes this position, and the recommendation moves to the right cell along with others. If you specify a position that exceeds the number of cells in the widget, the banner isn't displayed.
    
  ![](../_images/banner-position.png)


  One campaign may include multiple banners with different positions to be substituted in the widget. If the same campaign's banners complete for one position, a higher-priority banner is selected.

  {% note warning %}

  Check whether automatic placement of Yandex Advertising Network ads is enabled in the **Design** tab in the [recommendation widget settings](https://yandex.com/support/partner/web/recommendation-widget/create.html?lang=en). With automatic ad placement enabled, the Adfox banner isn't displayed when it gets to the position with a Yandex Advertising Network ad in the widget.

  {% endnote %}

- Replace all Yandex Advertising Network ads with your own banners if they have a higher CPM

  If you don't specify a position in the banner parameters, it attempts to replace the ad cell of the recommendation widget Yandex Advertising Network. When the total CPM of ad campaigns with such banners is higher than the CPM of the Yandex Advertising Network recommendation widget, your banners replace all ad cells in the widget.

  {% note warning %}

  The number of campaigns with your banners mustn't be fewer than the number of ad positions in the recommendation widget ad unit, and only one substitute banner is selected from each campaign.

  {% endnote %}

{% endlist %}

## Get the ad tag {#code}

Get the embed code [from the site](https://yandex.com/support/adfox/en/ad-inventory/codes/get-code.md#site-code) or [platform level](https://yandex.com/support/adfox/en/ad-inventory/codes/get-code.md#place-code) after adding a banner for placement.


<!-- source: en/_includes/feedback.md -->
## Contact support


<a href="en/form"> <!--ссылка, куда ведет кнопка. Если внутренняя ссылка, пишем без .md и .html --> 
  <span class="button">Send an email</span> <!--текст на кнопке--> 
</a>



<!-- source: en/_includes/styles/button.md -->

<!-- endsource: en/_includes/styles/button.md -->
<!-- endsource: en/_includes/feedback.md -->



