Hi, thanks for that but unfortunately it's not that simple (I did try after your suggestion).
I think it's to do with the {} or perhaps the fact this code uses function names?
In headerinclude I'm putting:
HTML Code:
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/100XX/160sky', [160, 600], 'div-gpt-ad-XX-0').addService(googletag.pubads());
googletag.defineSlot('/100XX/728-90-inpost', [728, 90], 'div-gpt-ad-XX-1').addService(googletag.pubads());
googletag.defineSlot('/100XX/728x90', [728, 90], 'div-gpt-ad-XX-2').addService(googletag.pubads());
googletag.defineSlot('/100XX/468banner', [468, 60], 'div-gpt-ad-XX-3').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
In my templates, to call an ad (for example) 160sky, I put:
HTML Code:
<div id='div-gpt-ad-XXXX-0' style='width:160px; height:600px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-XX-0'); });
</script>
</div>
Any ideas? Thanks