> For the complete documentation index, see [llms.txt](https://knowledgebase.offer18.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.offer18.com/ru/set/offery/teg-retargetinga.md).

# Тег ретаргетинга

Тег ретаргетинга — это фрагмент JavaScript-кода, который рекламодатель добавляет на веб-сайт или лендинг. Он помогает отслеживать поведение пользователей на сайте. Когда пользователь/посетитель посещает сайт, он собирает некоторые данные, такие как посещённая страница, IP-адрес и данные cookie и т.д. Это полезно для ретаргетинга пользователя после посещений.

Чтобы сохранить код ретаргетинга аффилиата в оффере, выполните следующие шаги:

#### 1. Перейдите в Предложения **»** Предложение — Одобрено

<figure><img src="/files/712faa875a07027d4905759a31690aad4e934da9" alt=""><figcaption></figcaption></figure>

#### 2. Нажмите на название/ID оффера, чтобы войти в панель его настроек.&#x20;

#### 3. Перейдите в «Ещё» **»** Теги ретаргетинга

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

#### 4. Нажмите «+ Добавить тег ретаргетинга»

#### 5. Укажите имя тега, выберите ID аффилиата

#### 6. Укажите URL (необязательно)

#### 7. Вставьте код/скрипт ретаргетинга аффилиата в поле «Код» **»** Отправить&#x20;

После отправки будет сгенерирован скрипт ретаргетинга Offer18, который необходимо разместить на сайте. Вы можете легко вносить изменения в код ретаргетинга аффилиата. Обновление скрипта ретаргетинга Offer18 займет некоторое время.

<figure><img src="/files/1e9dc4226408b753b143921ff651ef5659ed9803" alt=""><figcaption></figcaption></figure>

***

### Глобальный тег ретаргетинга

Чтобы использовать глобальный код ретаргетинга, выполните указанные ниже инструкции

#### **Настройка оффера**

Для глобального кода ретаргетинга обязательно включать параметры affiliate Id и offer Id и токен в URL оффера, а также во всех лендингах при создании оффера в панели Offer18.

```
https://example.com/?aff_id={aff_id}&offer_id={offerid} 
```

Этот код предназначен для размещения на сайте рекламодателя. Он автоматически обнаружит соответствующие данные браузера и выполнит скрипт ретаргетинга соответственно.

{% code overflow="wrap" %}

```javascript
<script>function p(n){return new URLSearchParams(window.location.search).get(n);}var a=p("aff_id"),o=p("offer_id");if(a&&o){var s=document.createElement("script");s.src="https://web-resources-dyn.offer18a.net/sdk/web/WebRTG.js?t=ao&a="+a+"&o="+o;s.async=true;document.body.appendChild(s);}</script>
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://knowledgebase.offer18.com/ru/set/offery/teg-retargetinga.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
