Sometimes you may want to add your logo to an ad space, or you may want to add an icon where the end-users can adjust their ad settings.
This example renders all kinds of ads, and adds a hovering logo to the top right of the ad space.
The screenshot shows the "AdChoices" logo:
Ad tag to be placed on the publisher page:
<!-- Ad tag begin -->
<div id="insertAdSpaceBeforeThis_000000000077eca4" style="display:none"></div>
<script type="text/javascript">
(function() { try { var scriptEl = document.createElement('script'); scriptEl.type = 'text/javascript'; scriptEl.async = 'async';
scriptEl.src = ('https:' == document.location.protocol) ? 'https://scdn.cxense.com/cx.js' : 'http://cdn.cxense.com/cx.js';
var targetEl = document.getElementsByTagName('script')[0]; targetEl.parentNode.insertBefore(scriptEl, targetEl); } catch (e) {}; }());
</script>
<script type="text/javascript">
var cX = cX || {}; cX.callQueue = cX.callQueue || [];
cX.callQueue.push(['insertAdSpace', {
adSpaceId:'000000000077eca4',
renderTemplateUrl: 'TemplateExample7.html',
width: 728, height: 90
}]);
</script>
<!-- Ad tag end end -->
Template code "TemplateExample7.html":
<!DOCTYPE html>
<html>
<head>
<title>Template with logo example</title>
<style type="text/css">
html, body { margin: 0; padding: 0; }
.template { display: none; }
</style>
</head>
<body>
<!-- Include the cx.js script -->
<script type="text/javascript" src="http://cdn.cxense.com/cx.js"></script>
<!-- The ads are inserted into this div: -->
<div id="adSpace">
<!-- This is the invisible template that is used to instanciate the ad -->
<div id="adsTemplate" class="template">
<!--%
var adSpace = data.searchResult.spaces[0];
for (var i = 0; i < adSpace.ads.length; i++) {
var ad = adSpace.ads[i];
cX.defaultAdRenderer(adSpace, ad);
}
%-->
</div>
</div>
<!-- This is the hovering logo, linking to the Cxense ad preferences page -->
<div style="position: absolute; top: 0; right: 0; padding: 0; margin: 0">
<a target="_blank" href="http://www.cxense.com/preferences">
<img style="border: 0" width="77" height="15" src="http://logos.cdn.cxpublic.com/AdChoices.png" alt="AdChoices" />
</a>
</div>
<!-- Insert AdSpace -->
<script type="text/javascript">
var cX = cX || {}; cX.callQueue = cX.callQueue || [];
cX.callQueue.push(['insertAdSpace', {
templateElementId: 'adsTemplate',
targetElementId: 'adSpace',
forwardHashArgs: true
}]);
</script>
</body>
</html>