# Инструкции по установке и применению кода в заглушку (stub code)

Добавление кода своей рекламы к коду блока позволит поставить заглушку (stub code) на случай, если на аукционе не будет подходящего предложения для показа

1. В ShowCase в блоке End mode выберите '3rd-party-no-ads' или '3rd-party-anyway'. В первом случае 3rd-party реклама будет показываться когда в основном блоке нет рекламы, а во втором в любом случае при её завершении
2. В случае баннерной рекламы, при выборе  '3rd-party-anyway' появляется поле 3rd-party timer (sec)  это задержка перед показом 3rd-party рекламы если реклама была найдена

<figure><img src="/files/Lf3QTFTWJFebqjRrybMp" alt=""><figcaption></figcaption></figure>

**Инструкция:**

1\. В блок code: \`\` вставьте 3rd-party код\
2\. Если в 3rd-party коде встречается вот такой текст "\</script>" то необходимо в ручную заменить его на "<\\/script>".\
3\. Отдельно обращаем внимание на строчку "window\.UTInventoryCoreFixedContainerSize('ut-embed');" она отвечает за то, чтобы при переключении нашей рекламы на 3rd-party не было CLS (cumulative shift layout - [`https://web.dev/articles/cls?hl=ru`](https://web.dev/articles/cls?hl=ru)). Делается это путем фиксации текущего размера контейнера в момент отключения нашей рекламы. Но на определенных страницах или сайтах (где вебмастера сами заботятся о том, как выглядит контейнер) эту строчку нужно убрать

**Код вставки для видео**&#x20;

<pre class="language-html"><code class="lang-html">&#x3C;!--В &#x3C;head> сайта один раз добавьте код загрузчика-->
<strong>&#x3C;script>
</strong>(function UTCoreInitialization() {
  if (window.UTInventoryCore) {
    new window.UTInventoryCore({
      type: "embed",
      host: 6,
      content: false,
      container: "ut-embed",
      width: 560,
      height: 315,
      playMode: "autoplay-visible",
      collapse: "none",
      callback: {
        all: (payload) => {
          if (payload === 'show') window.UTInventoryCoreShowFired = true;
          if (!window.UTInventoryCoreShowFired &#x26;&#x26; payload === 'finish') {
            // Уберите следующую строчку если не требуется фиксировать размер контейнера
            // или вы планируете работать с CSS самостоятельно
            window.UTInventoryCoreFixedContainerSize('ut-embed');
 
            window.UTInventoryCoreAdd3PartyCode({
              container: 'ut-embed',
              // Вставьте 3rd-party код.
              code: `
 
              `,
            });
          }
        },
      }
    });
    return;
  }
  setTimeout(UTCoreInitialization, 100);
})();
&#x3C;/script>
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.umg.team/main/ussp.io/instrukcii-po-ustanovke-i-primeneniyu-koda-v-zaglushku-stub-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
