Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

Google DFP mapping

0 votes
9 views
added Oct 26 in Google tools by LC Marshal Lieutenant (14,630 points)

On the template 

<div id='div-gpt-ad-1538471082052-0' class='wide-ad'>
	<script>
	googletag.cmd.push(function() { googletag.display('div-gpt-ad-1538471082052-0'); }); 
	</script>
</div>

 

On .js file

googletag.cmd.push(function() {

//staging mapping leaderboard
    var mappingBigleaderboard_home = googletag.sizeMapping().
            addSize([768, 0], [728, 250]). //desktop   
            addSize([500, 0], [425, 146]). //phone 
            addSize([0, 0], [320, 110]). //phone 
            build();
            
//staging big leaderboard
    window.BigStagingLeaderboardHomeSlot = googletag.defineSlot('/181891612/Staging_BigLeaderboard_Home', [[728, 250], [320, 110]], 'div-gpt-ad-1538471082052-0').defineSizeMapping(mappingBigleaderboard_home).addService(googletag.pubads()); 
    
    
    googletag.pubads().enableSingleRequest();
    googletag.pubads().enableSyncRendering();
    googletag.pubads().collapseEmptyDivs();
    googletag.enableServices();

});

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...