Creating search blocks

Ad blocks for search results can be placed on search platforms (for more information see creating and customizing platforms).

Search blocks that contain advertising linked to a user's search query context can be placed on search platforms (for more information see creating and customizing platforms).

Restriction.

It is prohibited to insert search code that sends manually defined search queries on theme-based pages (that do not display search results). This may lead to the partner's account being blocked.

The visual code designer is used to create ad blocks in the Advertising Network interface. The code designer lets you specify the desired format, select the appearance of your ad block and configure it to match the design of your site.

To create a new premium placement or Yandex.Direct search block, go to the list of search blocks (Products → Premium placement or Products → Yandex.Direct Search). Click Add special placement block or Add Yandex.Direct search block.

  1. Select a platform from the list to place your block and specify the block name in the form that opens on the General tab.

  2. Specify the maximum number of ads on the Formats tab:

    • For premium placement block: 1–3;
    • For Yandex.Direct search block: 1–9 (if a block is placed under the search results, it should contain at least 4 ads).

    Here you can also disable the display of sitelinks and advertiser site icons in this block.

  3. On the Direct design tab, you can set the block's visual design: set the font type and palette, select angle and borders shape. All changes to settings are immediately displayed in the test block. Please keep in mind that the design of your ad block significantly influences its CTR and, consequently, your site revenue.

    Attention. In accordance with the Terms of use, the Yandex.Direct link and the advertisers' domains shall be clearly visible and easily distinguishable.
  4. Click Create. Select a code execution type (synchronous/asynchronous) in the form that opens, copy your JavaScript code and insert it into the HTML code of the page where you want your ads to display.

    Tip. Please keep in mind that when copying code, your text editor could truncate or carry over lengthy strings, and JavaScript code could run incorrectly with such strings. Please be attentive and do not modify code when copying. The Copy to clipboard button is the best way to copy the code.

A unique ID will be assigned to the block after it is saved, and the block will be displayed in the list of Yandex.Direct blocks. A block ID (ID) consists of a product ID (P-A or D-A), platform ID (page_id) and the block's serial number.

Restriction. Please note that placing a premium placement block alone (with no Yandex.Direct ad block) is prohibited.

To correctly transfer a user search query to Yandex and obtain ads related to the query, specify the following variables in the block code:

  • search_text refers to the user's search query;

  • search_page_number refers to the search results page number.

Specify a variable/function/script (depending on the search solution used) in the search_text variable value. Sending pre-set search queries is prohibited.

Code sample for premium placement
Code sample for Yandex.Direct search block

If you want to create another block with the same settings, click Duplicate. The new block will be displayed in the list of search blocks.

To edit added blocks, go to the list of search blocks (Products → Premium placement or Products → Yandex.Direct Search). Find the block you need and click Edit.