Campaign

Examples of installing static ad units

Author

Tom Wendt

30 Apr 2026

Discover practical examples for integrating static ad blocks – from simple integration to advanced asynchronous implementation with multiple ad spaces.

Overview

In this article you will find various examples on how to integrate Static ad units.

If you have not yet completed the basic setup, we recommend first reading the article "How do you integrate a Static ad unit?".

Asynchronous Integration (Recommended)

Asynchronous integration is the recommended method because it improves your website's performance and supports additional features like events and callbacks.

Example: Two Ad Units on One Page

Step 1: Create HTML Containers

Place a unique container for each ad unit at the desired positions on your website.

<div id="adup1"></div><div id="adup2"></div>

Step 2: Load JavaScript API

Load the AdUp JavaScript API once and then initialize the desired ad units.

<script>window.uAd_init = function () {    window.uAd.embed("adup1", {        placementkey: "b438218268aff398aa44332004a8d78a",        responsive: false,        query: "Italien"    });    window.uAd.embed("adup2", {        placementkey: "c826aad8837fe2bd34f4aadde2cb222f",        responsive: false,        mincpc: 1.15,        lazy: true    });};if (typeof window.uAd === "object") {    window.uAd_init();} else {    (function(d, t) {        var g = d.createElement(t),            s = d.getElementsByTagName(t)[0];        g.src = "https://s.d.adup-tech.com/jsapi";        g.async = true;        s.parentNode.insertBefore(g, s);    }(document, "script"));}</script>
<script>window.uAd_init = function () {    window.uAd.embed("adup1", {        placementkey: "b438218268aff398aa44332004a8d78a",        responsive: false,        query: "Italien"    });    window.uAd.embed("adup2", {        placementkey: "c826aad8837fe2bd34f4aadde2cb222f",        responsive: false,        mincpc: 1.15,        lazy: true    });};if (typeof window.uAd === "object") {    window.uAd_init();} else {    (function(d, t) {        var g = d.createElement(t),            s = d.getElementsByTagName(t)[0];        g.src = "https://s.d.adup-tech.com/jsapi";        g.async = true;        s.parentNode.insertBefore(g, s);    }(document, "script"));}</script>
<script>window.uAd_init = function () {    window.uAd.embed("adup1", {        placementkey: "b438218268aff398aa44332004a8d78a",        responsive: false,        query: "Italien"    });    window.uAd.embed("adup2", {        placementkey: "c826aad8837fe2bd34f4aadde2cb222f",        responsive: false,        mincpc: 1.15,        lazy: true    });};if (typeof window.uAd === "object") {    window.uAd_init();} else {    (function(d, t) {        var g = d.createElement(t),            s = d.getElementsByTagName(t)[0];        g.src = "https://s.d.adup-tech.com/jsapi";        g.async = true;        s.parentNode.insertBefore(g, s);    }(document, "script"));}</script>

Advanced Asynchronous Integration

This example is particularly suitable for more complex websites.

The initialization is outsourced to a global function. As a result, the API is only loaded once and can then be used as often as needed.

This is useful when:

  • ads are loaded dynamically

  • multiple components contain ads

  • single-page applications are used

  • ad blocks only appear after user interaction

Step 1: Integrate Helper Function

Place the following code in the <head> of your website.

<script>function adup(callback) {    if (window.uAd) {        callback();    } else if (window.uAd_init) {        const oldCallback = window.uAd_init;        window.uAd_init = function () {            oldCallback();            callback();        };    } else {        window.uAd_init = callback;        (function(d, t) {            var g = d.createElement(t),                s = d.getElementsByTagName(t)[0];            g.src = "https://s.d.adup-tech.com/jsapi";            g.async = true;            s.parentNode.insertBefore(g, s);        }(document, "script"));    }}</script>
<script>function adup(callback) {    if (window.uAd) {        callback();    } else if (window.uAd_init) {        const oldCallback = window.uAd_init;        window.uAd_init = function () {            oldCallback();            callback();        };    } else {        window.uAd_init = callback;        (function(d, t) {            var g = d.createElement(t),                s = d.getElementsByTagName(t)[0];            g.src = "https://s.d.adup-tech.com/jsapi";            g.async = true;            s.parentNode.insertBefore(g, s);        }(document, "script"));    }}</script>
<script>function adup(callback) {    if (window.uAd) {        callback();    } else if (window.uAd_init) {        const oldCallback = window.uAd_init;        window.uAd_init = function () {            oldCallback();            callback();        };    } else {        window.uAd_init = callback;        (function(d, t) {            var g = d.createElement(t),                s = d.getElementsByTagName(t)[0];            g.src = "https://s.d.adup-tech.com/jsapi";            g.async = true;            s.parentNode.insertBefore(g, s);        }(document, "script"));    }}</script>

Step 2: Initialize Ad Unit

You can then load each ad unit independently of one another.

<div id="adup1"></div><script>adup(function () {    window.uAd.embed("adup1", {        placementkey: "b438218268aff398aa44332004a8d78a",        responsive: false,        query: "Italien"    });});<
<div id="adup1"></div><script>adup(function () {    window.uAd.embed("adup1", {        placementkey: "b438218268aff398aa44332004a8d78a",        responsive: false,        query: "Italien"    });});<
<div id="adup1"></div><script>adup(function () {    window.uAd.embed("adup1", {        placementkey: "b438218268aff398aa44332004a8d78a",        responsive: false,        query: "Italien"    });});<

Further ad units can be integrated in the same way.

Synchronous Integration

For simple websites, you can also integrate Static Ads synchronously.

In this case, the script is executed directly at the desired position.

<scriptsrc="https://s.d.adup-tech.com/ads/display.js?placementkey=ee3f328127873b8fc0174d84b235087b&query=Fl%C3%BCge;USA"></script>

Example with Additional Parameters

Optional parameters such as lazy or skip can also be passed directly via the URL.

<scriptsrc="https://s.d.adup-tech.com/ads/display.js?placementkey=058c43c27f6f563e09ddde3c26b54042&query=Fl%C3%BCge;USA&lazy=1&skip=5"></script>

Which Integration Method is Suitable When?

Asynchronous

Synchronous

Recommended for most websites

Suitable for simple integrations

Loads ads after page load

Loads ads directly during page load

Supports events and callbacks

No event support

Ideal for multiple ad units

Ideal for single ad units

Better performance

Simplest implementation

Best Practices

Load API Only Once

Even if multiple ad units are integrated, the AdUp JavaScript API should only be loaded once.

Prefer Asynchronous Integration

Asynchronous integration improves your website's performance and provides additional features for complex integrations.

Use Unique Containers

Each ad unit requires a unique container ID.

Example:

  • adup1

  • adup2

  • sidebar-ad

  • footer-ad

Utilise Lazy Loading

Enable lazy loading for ads that are located outside the immediately visible area.

This optimises loading time and impression tracking.

Common Sources of Error

API Integrated Multiple Times

The JavaScript API should only be loaded once per page.

Duplicate Container IDs

Use a unique ID for each ad unit.

Invalid Placement Key

An incorrect or missing placementkey prevents ads from being delivered.

Ad Unit Initialised Before API

Ensure that window.uAd.embed() is only executed after the API has fully loaded.