Installation

Examples for the installation of static ad units_

Here you can find some examples to help you with the installation of your static ad units. You can find detailed instructions in our support article on the installation of static ads.

Simple example of asynchronous integration

Perfectly adequate if the embed code is to be placed in only one place on your page.

Step 1

First, create the <div> containers with unique IDs in the places in the <body> area of your web page where you want the ads to load.

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

Step 2

Load our delivery API and initialize the callback "window.uAd_init" once at the end of your page. Within the callback, you now have the option to configure the ad media using the "window.uAd.embed" method and the desired parameters.

<script type="text/javascript">
    // Callback
    window.uAd_init = function() {
        window.uAd.embed("adup1", {
            placementkey: "b438218268aff398aa44332004a8d78a",
            responsive: false,
            query: "Italy"
        });
 
        window.uAd.embed("adup2", {
            placementkey: "c826aad8837fe2bd34f4aadde2cb222f",
            responsive: false,
            mincpc: 1.15,
            lazy: true
        });
    };
 
    // Loading the API
    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>

Extended example of asynchronous integration

Here, the logic from the simple example (above) is outsourced to a function called "adup". This takes care that our delivery API is loaded only once. A callback function with your desired embedding logic is passed as a parameter, which is automatically executed as soon as the API is ready. This is especially useful if, for example, you have several ads in different places on your page and / or ads should only be placed on your page during runtime.

Step 1

Place the following code in the <head> section of your web page.

<script type="text/javascript">
    function adup(callback) {
        if (window.uAd) {
            callback();
        } else if (window.uAd_init) {
            var 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

Place the <div> containers with unique IDs in the places in the <body> area of your web page where you want the ads to load, and then include them using the global function "adup" and the desired parameters.

...
<div id="adup1"></div>
<script type="text/javascript">
    adup(function() {
        window.uAd.embed("adup1", {
            placementkey: "b438218268aff398aa44332004a8d78a",
            responsive: false,
            query: "Italy"
        });
    });
</script>
...
<div id="adup2"></div>
<script type="text/javascript">
    adup(function() {
        window.uAd.embed("adup2", {
            placementkey: "c826aad8837fe2bd34f4aadde2cb222f",
            responsive: false,
            mincpc: 1.15,
            lazy: true
        });
    });
</script>
...

Example of synchronous integration

Add the <script> tags with the desired URL parameters to the <body> area on your page where you want the ads to appear.

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