Video Example
Please be informed that the following example is very basic. Make sure, that you use the correct config according to our documentation described on Somtag Integration, when you provide us your test pages.
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<script>
(function (s, o, m, t, a, g) {
s.somtag = {
cmd: function () {
g = [].slice.call(arguments);
g.push(o.currentScript || o.scripts[o.scripts.length - 1]);
(this.q = this.q || []).push(g);
} };
a = o.createElement('script');
a.src = m;
o.head.appendChild(a);
})(window, document, '//ad.71i.de/somtag/loader/loader.js');
somtag.cmd('init', {
config: {
id: 'demo_site', // Given by the SOM adtec team, 'demo_site' id is only for testing
},
video: {
blocks: {
pre: { enabled: true },
}
}
});
somtag.cmd('getVideoBlock', 'pre', {}, function (error, result) {
console.log("result", result);
// array of ad URLs:
[
"https://ad71.adfarm1.adition.com/lt?...",
"https://ad71.adfarm1.adition.com/lt?..."
];
});
</script>
</head>
<body>
<div id="pre">
<video src="any_video.mp4" width="800" height="600" controls >
</video>
</div>
</body>
</html>