Spanish Total.js
English
Documentation For AI agents
Contents

Put a banner on your website

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

.md GitHub
On this page

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 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

The second step: the tag of the banner

Add the code to your page

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

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

2. Paste the tag where the ad must appear:

<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:

<!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

When the page loads, each tag shows one campaign of its banner. Read 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:

bannersystemrefresh();

Each tag then shows the next campaign of its banner.

Made in Europe