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 under certain circumstances the global callback function window.uAd_init may be executed multiple times, causing the corresponding advertising materials to also be displayed multiple times!

Loading via <script> tag (simple)

Entirely sufficient if the integration code is only to be placed in one location on your page. Our delivery API is loaded once and asynchronously via 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)

This involves moving the logic from the simple example (above) into a function named "adup". This function ensures that the API is only loaded once. A callback function containing your desired integration logic is passed as a parameter and is executed automatically as soon as our delivery API is ready.

This is particularly useful if, for example, you have placed multiple advertising materials in different locations on your page and/or want to place, update or remove advertising materials on your page dynamically 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. Afterwards, our API can 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 materials

Prerequisites

To integrate advertising materials asynchronously, you must ensure that the delivery API has been loaded correctly. You can find more information about this in the Loading the API section further up this page.

How it works

Using the embed function of the API object window.uAd, you have the option to load advertising materials inside an HTML container existing 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 material 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"));
<

...
<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"));
<

...
<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"));
<

Further integration examples can be found in the documentation for Responsive Ads and Static Ads.

Updating advertising materials

Prerequisites

To be able to update advertising materials, you must ensure that the delivery API has been loaded correctly. You can find more information about this in the Loading the API section further up this page.

How it works

Using the reload function of the API object window.uAd, you have the option to update an already existing advertising material. To do this, the unique ID of the advertising material's HTML container is passed to the window.uAd.reload function. The iFrame with the advertisements previously generated by window.uAd.embed is reloaded with the same options. 

Advertising material may be updated at most once every 10 seconds using window.uAd.reload. Updating an advertising material 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() {
        // Initial integration
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });

        // Automatic update every 30 seconds
        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"));
<

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

        // Automatic update every 30 seconds
        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"));
<

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

        // Automatic update every 30 seconds
        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"));
<

Removing advertising materials

Prerequisites

To be able to remove advertising materials, you must ensure that the delivery API has been loaded correctly. You can find more info 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, you have the option to remove an advertising material that was already added by embed. To do this, the unique ID of the HTML container of the advertising material 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() {
        // Initial integration
        window.uAd.embed("adup1", {
            placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
            responsive: false
        });

        // Removes advertising material after 120 seconds
        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"));
<

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

        // Removes advertising material after 120 seconds
        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"));
<

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

        // Removes advertising material after 120 seconds
        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"));
<