> For the complete documentation index, see [llms.txt](https://docs.exads.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exads.com/advertisers/campaigns/third-party-ad-serving.md).

# Third Party Ad-Serving

When **HTML & Iframe** is enabled for an account, you can create HTML campaigns using an iFrame, HTML5, or a script instead of an image.

In [Step 2: **Ads**](/advertisers/campaigns/creating-a-campaign/step-2-ads.md), select **HTML Tags**, then click **+AD VARIATIONS** and paste the campaign ad tag.

<figure><img src="https://2122107279-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FualFKt6C8xdYfe2WEYpJ%2Fuploads%2F7R7nqbfUGiH2B3b5Lhyu%2Fstep2-htmltags-advariation.png?alt=media&amp;token=479d9025-3bfb-444b-8c16-2b056fe19f79" alt=""><figcaption></figcaption></figure>

## Click URL <a href="#click-url" id="click-url"></a>

As HTML Campaigns are served through a third party server, they need to use an extra parameter named `{click_url}` to register conversions and clicks. This parameter needs to be implemented in two places in order to work: In the Ad tag itself and in the host page that generates the HTML banner.

### Step 1: Ad tag <a href="#step-1-a-d-tag" id="step-1-a-d-tag"></a>

Add `{click_url}` to the ad tag:

```js
<body style="margin: 0px"><iframe id='a628d52a' name='a628d52a' src='https://ad.third-party-server.com/iframe?tag={conversions_tracking}&click_url={click_url}' frameborder='0' scrolling='no' width='300' height='250'></iframe></body>
```

### Step 2: Host Page <a href="#step-2-host-page" id="step-2-host-page"></a>

On the host page, (whether it uses PHP or any other programming language), you need to add 2 things:

* The click\_url:
* The tracker for server to server tracking

**A: PHP example (to be added at the beginning of the page)**

GET the variables from the iFrame (HTML):

```js
<?php
$tag_tracker = isset($_GET['tag']) ? $_GET['tag'] : '';
$click_url = isset($_GET['click_url']) ? $_GET['click_url'] : '';
?>
```

**B: Link Code**

Add the `click_url` and tracker to the link code that wraps the HTML banner:

```js
<a target="_blank" href='<?php echo $click_url ?>https://ad.third-party-server-ad.com/click?tag=<?php echo $tag_tracker ?>' >
```

{% hint style="info" %}
The `click_url` always ends with `;`. This separates it from the destination URL. Please do not remove any parameters from the click\_url or trim it in any way. Your url should simply be appended directly after (preserving everything as is, including the semicolon ;)
{% endhint %}

### Step 3: Final Result <a href="#step-3-final-result" id="step-3-final-result"></a>

The final result of the link should be:

```js
{click_url}https://ad.third-party-server-ad.com/click?tag={conversions_tracking}
```

The server automatically removes `{click_url}` and redirects the visitor to the destination page.


---

# 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.exads.com/advertisers/campaigns/third-party-ad-serving.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.
