> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/rtb/publishers/exoclick-rtb/exoclick-rtb-publisher-code-examples.md).

# ExoClick RTB Examples

## ExoClick RTB Publisher Request

### POST Banner JSON

```json
{
    "id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
    "ip": "131.34.123.159",
    "language": "en",
    "type": "banner",
    "remote_addr": "131.34.123.159",
    "x_forwarded_for": "",
    "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
    "url": "https://sitedomain.com/page",
    "user_id": "57592f333f8983.043587162282415065",
    "sub": 1234,
    "export": "json",
    "keyword": "lifestyle, humour",
    "size": "300x250"
}
```

### POST Popunder JSON

```json
{
    "id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
    "ip": "131.34.123.159",
    "language": "en",
    "type": "popunder",
    "remote_addr": "131.34.123.159",
    "x_forwarded_for": "120.52.73.97",
    "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
    "url": "https://sitedomain.com/page",
    "user_id": "57592f333f8983.043587162282415065",
    "sub": 4312,
    "export": "json",
    "keyword": "lifestyle, humour"
}
```

### POST Push Notifications - 720 x 480 JSON

```json
{
    "id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
    "ip": "131.34.123.159",
    "language": "en",
    "type": "push_notification",
    "remote_addr": "131.34.123.159",
    "x_forwarded_for": "120.52.73.97",
    "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
    "url": "https://sitedomain.com/page",
    "user_id": "57592f333f8983.043587162282415065",
    "sub": 4312,
    "export": "json",
    "keyword": "lifestyle, humour",
    "size": "720x480"
}
```

### POST Push Notifications 192 x 192 JSON

```json
{
    "id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
    "ip": "131.34.123.159",
    "language": "en",
    "type": "push_notification",
    "remote_addr": "131.34.123.159",
    "x_forwarded_for": "120.52.73.97",
    "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
    "url": "https://sitedomain.com/page",
    "user_id": "57592f333f8983.043587162282415065",
    "sub": 4312,
    "export": "json",
    "keyword": "lifestyle, humour",
    "size": "192x192"
}
```

### POST In-Page Push JSON

```json
{
    "id": "5c2e180f3a1371d9256f6616c6792fb2c7a64772",
    "ip": "131.34.123.159",
    "language": "en",
    "type": "in_page_push_notification",
    "remote_addr": "131.34.123.159",
    "x_forwarded_for": "120.52.73.97",
    "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
    "url": "https://sitedomain.com/page",
    "user_id": "57592f333f8983.043587162282415065",
    "sub": 1234,
    "export": "json",
    "keyword": "lifestyle, humour"
}
```

### POST Direct Link JSON

```json
{
    "id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
    "ip": "131.34.123.159",
    "language": "en",
    "type": "direct_link",
    "remote_addr": "131.34.123.159",
    "x_forwarded_for": "120.52.73.97",
    "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
    "url": "https://sitedomain.com/page",
    "user_id": "57592f333f8983.043587162282415065",
    "sub": 4312,
    "export": "json",
    "keyword": "lifestyle, humour",
    "el": "dGVzdEBleGFkcy5jb20="
}
```

### POST Email Clicks JSON

```json
{
    "id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
    "ip": "131.34.123.159",
    "language": "en",
    "type": "email_click",
    "remote_addr": "131.34.123.159",
    "x_forwarded_for": "120.52.73.97",
    "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36",
    "url": "https://sitedomain.com/page",
    "user_id": "57592f333f8983.043587162282415065",
    "sub": 4312,
    "export": "json",
    "keyword": "lifestyle, humour",
    "el": "dGVzdEBleGFkcy5jb20="
}
```

### GET Banner URL

```
https://rtb.{examplenetworkdomain}/rtb.php?idzone=2999625&fid=bc64cd7206ae2b2d4346f73629595660d3d117ac&id=d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa&ip=131.34.123.159&language=en&type=banner&remote_addr=131.34.123.159&ua=Mozilla/5.0%20(X11;%20Linux%20x86_64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/66.0.3359.139%20Safari/537.36&url=https://sitedomain.com/page&user_id=57592f333f8983.043587162282415065&sub=1234&export=json&keyword=lifestyle,humour&size=300x250
```

### GET Email Clicks URL

```
https://rtb.{networkdomain}/rtb.php?idzone=2999625&fid=bc64cd7206ae2b2d4346f73629595660d3d117ac&id=d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa&type=email_click&keyword=lifestyle,humour&export=xml&ip=192.168.1.70&ua=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36&user_id=1&el=dGVzdGVAZW1haWwuY29t
```

### GET Popunder URL

```
https://rtb.{examplenetworkdomain}/rtb.php?idzone=2999625&fid=bc64cd7206ae2b2d4346f73629595660d3d117ac&id=d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa&ip=131.34.123.159&language=en&type=popunder&remote_addr=131.34.123.159&x_forwarded_for=120.52.73.97&ua=Mozilla/5.0%20(X11;%20Linux%20x86_64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/66.0.3359.139%20Safari/537.36&url=https://sitedomain.com/page&user_id=57592f333f8983.043587162282415065&sub=4312&export=json&keyword=lifestyle,humour
```

### GET Push Notifications 720 x 480 URL

```
https://rtb.{examplenetworkdomain}/rtb.php?idzone=2999625&fid=bc64cd7206ae2b2d4346f73629595660d3d117ac&id=d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa&ip=131.34.123.159&language=en&type=push_notification&remote_addr=131.34.123.159&x_forwarded_for=120.52.73.97&ua=Mozilla/5.0%20(X11;%20Linux%20x86_64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/66.0.3359.139%20Safari/537.36&url=https://sitedomain.com/page&user_id=57592f333f8983.043587162282415065&sub=4312&export=json&keyword=lifestyle,humour&size=720x480
```

### GET Push Notifications 192 x 192 URL

```
https://rtb.{examplenetworkdomain}/rtb.php?idzone=2999625&fid=bc64cd7206ae2b2d4346f73629595660d3d117ac&id=d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa&ip=131.34.123.159&language=en&type=push_notification&remote_addr=131.34.123.159&x_forwarded_for=120.52.73.97&ua=Mozilla/5.0%20(X11;%20Linux%20x86_64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/66.0.3359.139%20Safari/537.36&url=https://sitedomain.com/page&user_id=57592f333f8983.043587162282415065&sub=4312&export=json&keyword=lifestyle,humour&size=192x192
```

### GET In-Page Push Notifications URL

```
http://rtb.{examplenetworkdomain}/rtb.php?idzone=5307609&fid=bd1110cd7802712c5f7abb146954fb89748c236b&id=d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa&ip=131.34.123.159&language=en&type=in_page_push_notification&remote_addr=131.34.123.159&x_forwarded_for=120.52.73.97&ua=Mozilla/5.0%20(X11;%20Linux%20x86_64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/66.0.3359.139%20Safari/537.36&url=https://sitedomain.com/page&user_id=57592f333f8983.043587162282415065&sub=4312&export=json&keyword=lifestyle,humour&size=192x192
```

### GET Direct Link URL

```
http://rtb.{examplenetworkdomain}/rtb.php?idzone=3206099&fid=326d931254f7552d8f3b80cf34e9e09a2924867c&ua=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36&ip=131.34.123.159&id=d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa&type=direct_link&keyword=lifestyle,humour&export=xml&el=dGVzdGVAZW1haWwuY29t
```

## ExoClick RTB Publisher Response

### Banner JSON

```json
{
    "bid": {
        "id" : "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
        "imgUrl" : "http://mysite.com/images/myad.jpg",
        "clickUrl" : "http://mysite.com/landingpages/mypage",
        "nUrl": "http://network-domain.com/win-notification",
        "btype": 1,
        "value" : 12.34
    }
}
```

### Direct Link JSON

```json
{
    "bid": {
        "id" : "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
        "url" : "http://mysite.com/landingpages/mypage",
        "nUrl": "http://network-domain.com/win-notification",
        "btype": 2,
        "value" : 0
    }
}
```

### Email Clicks JSON

```json
{
    "bid": {
        "id": "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
        "clickUrl": "http://mysite.com/landingpages/mypage?el={email_encoded}",
        "value": 0.07,
        "btype": 2,
        "nUrl": "https://mysite.com/my_notification_url"
    }
}
```

### Popunder JSON

```json
{
    "bid": {
        "id" : "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
        "url" : "http://mysite.com/landingpages/mypage",
        "nUrl": "http://network-domain.com/win-notification",
        "btype": 1,
        "value" : 21.13
    }
}
```

### Push Notifications JSON

```json
{
    "bid": {
        "id" : "d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa",
        "iconUrl" : "http://mysite.com/images/myadicon.jpg",
        "clickUrl" : "http://mysite.com/landingpages/mypage",
        "nUrl": "http://network-domain.com/win-notification",
        "title": "My Ad Title",
        "description": "My Ad Description Text",
        "btype": 2,
        "value" : 0.13
    }
}
```

### In-Page Push JSON

```json
{
    "bid": {
        "id": "5c2e180f3a1371d9256f6616c6792fb2c7a64772",
        "value": 0.0035,
        "clickUrl": "http://mysite.com/landingpages/mypage",
        "imgUrl": "http://mysite.com/images/myad.jpg",
        "title": "Title",
        "description": "Description",
        "btype": 1,
        "nUrl": "http://network-domain.com/win-notification"
    }
}
```

### Banner XML

```xml
<?xml version="1.0"?>
<result>
    <bid>
        <id>d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa</id>
        <clickUrl><![CDATA[http://mysite.com/landingpages/mypage]]></clickUrl>
        <imgUrl><![CDATA[http://mysite.com/images/myad.jpg]]></imgUrl>
        <nUrl><![CDATA[http://network-domain.com/win-notification]]></nUrl>
        <btype>1</btype>
        <value>12.34</value>
    </bid>
</result>
```

### Direct Link XML

```xml
<?xml version="1.0"?>
<result>
    <bid>
        <id><![CDATA[d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa]]></id>
        <clickUrl><![CDATA[http://mysite.com/landingpages/mypage]]></clickUrl>
        <value><![CDATA[0]]></value>
        <btype><![CDATA[2]]></btype>
        <nUrl><![CDATA[http://network-domain.com/win-notification]]></nUrl>
    </bid>
</result>
```

### Email Clicks XML

```xml
<?xml version="1.0"?>
<result>
    <bid>
        <id>
            <![CDATA[d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa]]>
        </id>
        <clickUrl>
            <clickUrl><![CDATA[http://mysite.com/landingpages/mypage?el={email_encoded}]]></clickUrl>
        </clickUrl>
        <value>
            <![CDATA[0.07]]>
        </value>
        <btype>
            <![CDATA[2]]>
        </btype>
        <nUrl>
            <![CDATA[https://mysite.com/my_notification_url]]>
        </nUrl>
    </bid>
</result>
```

### Popunder XML

```xml
<?xml version="1.0"?>
<result>
    <bid>
        <id>d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa</id>
        <url><![CDATA[http://mysite.com/landingpages/mypage]]></url>
        <nUrl><![CDATA[http://network-domain.com/win-notification]]></nUrl>
        <btype>1</btype>
        <value>21.13</value>
    </bid>
</result>
```

### Push Notifications XML

```xml
<?xml version="1.0"?>
<result>
    <bid>
        <id>d4b5c697-41f3-4c1c-a3d5-5fd01b5ef2aa</id>
        <iconUrl><![CDATA[http://mysite.com/images/myad.jpg]]></iconUrl>
        <clickUrl><![CDATA[http://mysite.com/landingpages/mypage]]></clickUrl>
        <nUrl><![CDATA[http://network-domain.com/win-notification]]></nUrl>
        <title>My Ad Title</title>
        <description>My Ad Description Text</description>
        <btype>2</btype>
        <value>0.13</value>
    </bid>
</result>
```


---

# 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://docs.exoclick.com/rtb/publishers/exoclick-rtb/exoclick-rtb-publisher-code-examples.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.
