Forum Moderators: martinibuster
<script async="async" src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
var slot = new Array();
googletag.cmd.push(function() {
slot[0] = googletag.defineSlot('/xxxx/320x50_Mobile_ATF',
[320, 50], 'adslot0')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.pubads().disableInitialLoad();
googletag.enableServices();
});
</script>
// Later in the page
<div id='adslot0' style='height:50px; width:320px;'>
<script>
googletag.cmd.push(function() {
googletag.display('adslot0');
googletag.pubads().refresh([slot[0]]);
});
</script>
</div> <div data-b="0" class="a ctr">
<div class="lb_728">
// code for 728x90
</div>
<div class="lb_mobile">
// code for 320x50
</div>
</div> <script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
var slot = new Array();
googletag.cmd.push(function() {
if (screen.width >= 728 && screen.width <= 975)
slot[0] = googletag.defineSlot('/xxxx/728x90_Leaderboard_ATF',
[728, 90], 'adslot0')
.addService(googletag.pubads());
if (screen.width < 728)
slot[1] = googletag.defineSlot('/xxxx/320x50_Mobile_ATF',
[320, 50], 'adslot1')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.pubads().disableInitialLoad();
googletag.enableServices();
});
</script>
<div data-b="0" class="a ctr">
<div class="lb_728">
<div id='adslot0' style='height:90px; width:728px;'>
<script>
if (slot[0])
googletag.cmd.push(function() {
googletag.display('adslot0');
googletag.pubads().refresh([slot[0]]);
});
</script>
</div>
</div>
<div class="lb_mobile">
<div id='adslot1' style='height:50px; width:320px;'>
<script>
if (slot[1])
googletag.cmd.push(function() {
googletag.display('adslot1');
googletag.pubads().refresh([slot[1]]);
});
</script>
</div>
</div>
</div>
googletag.defineSlot('/1003454/DFPADUnitName',...