---
title: Put a banner on your website
project: BannerSystem
version: 1.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/bannersystem/1-0/guides/embed-a-banner/
updated: 2026-11-19T04:30:09.166Z
---

# Put a banner on your website

> Copy the embed code of a banner and add it to the pages of your website.

Each banner has an embed code with two parts: one script for the whole page and one tag for each place where the banner appears.

## Open the address of BannerSystem that your visitors can reach

The embed code uses the address that you use to open the administration. Open BannerSystem through its public address, for example `https://ads.example.com/setup/?token=YOUR_TOKEN`, before you copy the code and before you upload images. Read [Config file](../../reference/config-file/) if BannerSystem runs behind another address.

## Copy the code

1. Open **Banners** and click the banner.
2. In the **Actions** panel, click **Set up a banner on your website**.
3. The first step shows the script. Click the code to copy it. BannerSystem shows **Copied to clipboard.**
4. Click **NEXT**.
5. The second step shows the tag of the banner. Click it to copy it.

![The first step: the script](/files/JaozTu2E961f.webp)

![The second step: the tag of the banner](/files/JaozTw2F960f.webp)

## Add the code to your page

**1.** Paste the script once, at the bottom of the page, before `</body>`:

```html
<script src="https://ads.example.com/x.min.js" async defer></script>
```

**2.** Paste the tag where the ad must appear:

```html
<div class="x" data-id="BANNER_ID"></div>
```

The value of `data-id` is the id of the banner. You can add the same tag several times, and tags of several banners, on one page. The script is still needed only once.

A complete page with two banners:

```html
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Demo site</title>
</head>
<body>
	<header>Demo site</header>
	<div class="x" data-id="HOMEPAGE_TOP_ID"></div>
	<p>The content of your page.</p>
	<aside>
		<div class="x" data-id="SIDEBAR_ID"></div>
	</aside>
	<script src="https://ads.example.com/x.min.js" async defer></script>
</body>
</html>
```

![The demo page with both banners](/files/JaozTy2G961f.webp)

When the page loads, each tag shows one campaign of its banner. Read [How banners are shown](../how-banners-are-shown/).

## Load new ads without reloading the page

On a page that changes its content without reloading, for example a single-page application, call this function to load the banners again:

```javascript
bannersystemrefresh();
```

Each tag then shows the next campaign of its banner.
