Campaign

Our Delivery API

Use the AdUp Delivery API to programmatically integrate, update or remove ads – ideal for dynamic websites and modern web applications.

Loading the API

It must always be ensured that the delivery API is only loaded once per page view , otherwise the global callback function window.uAd_init may be executed multiple times, causing the respective advertising media to also be displayed multiple times!

Loading via <script> tag (simple)

Perfectly sufficient if the integration code is only to be placed in a single location on your page. Our delivery API is loaded once and asynchronously by means of a dynamic <script> tag. As soon as the API is fully loaded, a global callback function window.uAd_init is executed, in which your actual integration logic is stored.

<script type="text/javascript">
    window.uAd_init = function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    };
  
    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 type="text/javascript">
    window.uAd_init = function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    };
  
    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 type="text/javascript">
    window.uAd_init = function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    };
  
    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>

Loading via <script> tag (advanced)

Here, the logic from the simple example (above) is outsourced to a function called “adup”. This ensures that the API is only loaded once. A callback function containing your desired integration logic is passed as a parameter, which is automatically executed as soon as our delivery API is ready.

This is particularly useful if, for example, you have installed multiple advertising media in different locations on your page and/or wish to place, update or remove advertising media on your page during runtime.

<script type="text/javascript">
    function onAdupReady(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>

<script type="text/javascript">
    onAdupReady(function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    });
</script>

<script type="text/javascript">
    onAdupReady(function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    });
</script>
<script type="text/javascript">
    function onAdupReady(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>

<script type="text/javascript">
    onAdupReady(function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    });
</script>

<script type="text/javascript">
    onAdupReady(function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    });
</script>
<script type="text/javascript">
    function onAdupReady(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>

<script type="text/javascript">
    onAdupReady(function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    });
</script>

<script type="text/javascript">
    onAdupReady(function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    });
</script>

Loading as an AMD module

The API can be loaded as an AMD module (http://requirejs.org/docs/whyamd.html).
This method requires the use of an AMD loader (e.g. http://requirejs.org).

To do this, the path to the API must first be defined in the RequireJS options and the RequireJS library must be integrated. Our API can then be loaded or used anywhere on your page using the require method.

<script type="text/javascript">
    var require = {
        paths: {
            "uAd": "https://s.d.adup-tech.com/jsapi"
        }
    };
</script>

<script type="text/javascript" 
        src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js">
</script>

<script type="text/javascript">
    require(["uAd"], function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    }); 
</script>

<script type="text/javascript">
    require(["uAd"], function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    }); 
</script>
<script type="text/javascript">
    var require = {
        paths: {
            "uAd": "https://s.d.adup-tech.com/jsapi"
        }
    };
</script>

<script type="text/javascript" 
        src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js">
</script>

<script type="text/javascript">
    require(["uAd"], function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    }); 
</script>

<script type="text/javascript">
    require(["uAd"], function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    }); 
</script>
<script type="text/javascript">
    var require = {
        paths: {
            "uAd": "https://s.d.adup-tech.com/jsapi"
        }
    };
</script>

<script type="text/javascript" 
        src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js">
</script>

<script type="text/javascript">
    require(["uAd"], function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    }); 
</script>

<script type="text/javascript">
    require(["uAd"], function() {
        // window.uAd.embed(...)
        // window.uAd.reload(...)
        // window.uAd.remove(...)
    }); 
</script>

Integrating advertising media

Requirements

In order for you to integrate advertising media asynchronously, you must ensure that the delivery API has been loaded correctly. You can find more information on this in the Loading the API section further up this page.

How it works

Using the embed function of the API object window.uAd allows you to load advertising media within an existing HTML container on your page. The HTML container must have a unique ID, which is passed as the first parameter when calling window.uAd.embed. The options for the desired advertising medium are passed as the second parameter in the form of a JSON object. The API then generates an iFrame with the corresponding advertisements inside the HTML container.

Syntax

window.uAd.embed("Container-ID", {
    Option: "Wert",
    Option: "Wert",
    
});
window.uAd.embed("Container-ID", {
    Option: "Wert",
    Option: "Wert",
    
});
window.uAd.embed("Container-ID", {
    Option: "Wert",
    Option: "Wert",
    
});

Example

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

<script type="text/javascript">
    window.uAd_init = function() {
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });
    };
  
    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>
<div id="adup1"></div>

<script type="text/javascript">
    window.uAd_init = function() {
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });
    };
  
    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>
<div id="adup1"></div>

<script type="text/javascript">
    window.uAd_init = function() {
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });
    };
  
    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>

You can find further integration examples in the documentation for Responsive Ads and Static Ads.

Updating advertising media

Requirements

In order for you to update advertising media, you must ensure that the delivery API has been loaded correctly. You can find more information on this in the Loading the API section further up this page.

How it works

Using the reload function of the API object window.uAd allows you to update an already existing advertising medium. For this purpose, the unique ID of the HTML container of the advertising medium is passed to the window.uAd.reload function. The iFrame with the advertisements previously generated by window.uAd.embed is reloaded here with the same options. 

An advertising medium may be updated at most every 10 seconds using window.uAd.reload. Updating an advertising medium always tracks a new impression as well.

Syntax

window.uAd.reload("Container-ID");
window.uAd.reload("Container-ID");
window.uAd.reload("Container-ID");

Example

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

<script type="text/javascript">
    window.uAd_init = function() {
        // Initiale Einbindung
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });

        // Automatische Aktualisierung alle 30 Sekunden
        setInterval(function() {
             window.uAd.reload("adup1");  
        }, 30000);
    };
  
    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>
<div id="adup1"></div>

<script type="text/javascript">
    window.uAd_init = function() {
        // Initiale Einbindung
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });

        // Automatische Aktualisierung alle 30 Sekunden
        setInterval(function() {
             window.uAd.reload("adup1");  
        }, 30000);
    };
  
    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>
<div id="adup1"></div>

<script type="text/javascript">
    window.uAd_init = function() {
        // Initiale Einbindung
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });

        // Automatische Aktualisierung alle 30 Sekunden
        setInterval(function() {
             window.uAd.reload("adup1");  
        }, 30000);
    };
  
    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>

Removing advertising media

Requirements

In order for you to remove advertising media, you must ensure that the delivery API has been loaded correctly. You can find more information on this in the Loading the API section further up this page.

How it works

Using the remove function of the API object window.uAd allows you to remove an advertising medium that has already been inserted by embed. For this purpose, the unique ID of the HTML container of the advertising medium to be removed is passed to the window.uAd.remove function.

Syntax

window.uAd.remove("Container-ID");
window.uAd.remove("Container-ID");
window.uAd.remove("Container-ID");

Example

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

<script type="text/javascript">
    window.uAd_init = function() {
        // Initiale Einbindung
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });

        // Entfernt Werbemittel nach 120 Sekunden
        setTimeout(function() {
             window.uAd.remove("adup1");  
        }, 120000);
    };
  
    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>
<div id="adup1"></div>

<script type="text/javascript">
    window.uAd_init = function() {
        // Initiale Einbindung
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });

        // Entfernt Werbemittel nach 120 Sekunden
        setTimeout(function() {
             window.uAd.remove("adup1");  
        }, 120000);
    };
  
    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>
<div id="adup1"></div>

<script type="text/javascript">
    window.uAd_init = function() {
        // Initiale Einbindung
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });

        // Entfernt Werbemittel nach 120 Sekunden
        setTimeout(function() {
             window.uAd.remove("adup1");  
        }, 120000);
    };
  
    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>