# Retargeting Tag

Retargeting tag is a piece of JavaScript code that an advertiser adds to a website or landing page. It helps to track user behavior on a website. When a user/visitor visits the website, it collects some data such as the page visited, IP address, and cookie details, etc. It is helpful to retarget the user after post visits.

To save an affiliate's retargeting code in the offer, follow these steps:

#### 1. Go to Offers **»** Offer - Approved

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

#### 2. Click on Offer name / ID to enter into its configurations panel.&#x20;

#### 3. Go to More **»** Retargeting Tags

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

#### 4. Click on "+ Add Retargeting Tag"

#### 5. Define tag name, Select Affiliate ID

#### 6. Place URL (optional)

#### 7. Place affiliate retag code/script in "Code" **»** Submit&#x20;

After submitting, Offer18's retargeting script will be generated and needs to be placed on the website. You can easily make changes in the affiliate's retargeting code. The Offer18 retargeting script will take some time to update.

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

***

### Global Retargeting tag

In order to use Global retargeting code, follow the instructions given below

#### **Offer Setup**

For Global retargeting code, it is mandatory to include affiliate Id and offer Id parameter and token in the Offer URL and also for all the landing pages while creating offer in Offer18 dashboard.

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

This code is intended for placement on the advertiser's website. It will automatically detect relevant browser data and execute the retargeting script accordingly.

{% 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: 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://knowledgebase.offer18.com/network/offers/retargeting-tag.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.
