Loading the API
It must always be ensured that the delivery API is loaded only once per page view , otherwise the global callback function window.uAd_init may be executed multiple times under certain circumstances, and thus the corresponding advertising materials will also be displayed multiple times!
Loading via <script> tag (simple)
Entirely sufficient if the integration code is to be placed in only one 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() {
};
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() {
};
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() {
};
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 shifts the logic from the simple example (above) into a function called "adup". This ensures that the API is only loaded once. A callback function with 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 several advertising materials in different locations on your page and/or advertising materials are to be placed, updated or removed 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() {
});
</script>
<script type="text/javascript">
onAdupReady(function() {
});
</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() {
});
</script>
<script type="text/javascript">
onAdupReady(function() {
});
</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() {
});
</script>
<script type="text/javascript">
onAdupReady(function() {
});
</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. Subsequently, our API can be loaded or used anywhere on your page with the help of 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() {
});
</script>
<script type="text/javascript">
require(["uAd"], function() {
});
</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() {
});
</script>
<script type="text/javascript">
require(["uAd"], function() {
});
</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() {
});
</script>
<script type="text/javascript">
require(["uAd"], function() {
});
</script>Integrate advertising material
Prerequisites
In order for you to be able to integrate advertising materials asynchronously, it must be ensured that the delivery API has been loaded correctly. You can find more details in the Loading the API section further up on this page.
How it works
Using the embed function of the API object window.uAd, you have the option to load advertising material inside 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 material are passed as a second parameter in the form of a JSON object. The API then generates an iframe containing 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 on Responsive Ads and Static Ads.
Update advertising material
Prerequisites
In order for you to be able to update advertising materials, it must be ensured that the delivery API has been loaded correctly. You can find more details in the Loading the API section further up on 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 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 thereby reloaded with the same options.
An advertising medium may be updated at most every 10 seconds via 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() {
window.uAd.embed("adup1", {
placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
responsive: false
});
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() {
window.uAd.embed("adup1", {
placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
responsive: false
});
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() {
window.uAd.embed("adup1", {
placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
responsive: false
});
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"));
<
Remove advertising material
Prerequisites
In order for you to be able to remove advertising materials, it must be ensured that the delivery API has been loaded correctly. You can find more details in the Loading the API section further up on this page.
How it works
Using the remove function of the API object window.uAd , you have the option of removing an advertising medium that has already been inserted via 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() {
window.uAd.embed("adup1", {
placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
responsive: false
});
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() {
window.uAd.embed("adup1", {
placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
responsive: false
});
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() {
window.uAd.embed("adup1", {
placementkey: "dd9e2c6e8a1ec4bc5d1561564fcf946d",
responsive: false
});
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"));
<