google DFP widget ad code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this goes in <head> | |
<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('/80273159/nodebbtest', [160, 600], 'div-gpt-ad-1451410127852-0').addService(googletag.pubads()); | |
googletag.pubads().enableSingleRequest(); | |
googletag.enableServices(); | |
}); | |
</script> | |
// below goes in body | |
<!-- /80273159/nodebbtest --> | |
<div id='div-gpt-ad-1451410127852-0' style='height:600px; width:160px;'> | |
<script type='text/javascript'> | |
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1451410127852-0'); }); | |
</script> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment