I have been trying to get Doubleclick ad tags to load with my dynamic content. I have a website which loads more content as you scroll down rather than having to go to the next page, back a page, etc. However I have been unsuccessful in getting my ads which I have on every 2nd to 3rd page to load.
Does anyone know how to do this?
Thanks.
edit
Code in the header:
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/XXX/XXX', [300, 250], 'div-gpt-ad-XXX-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
I have also tried removing "enableSingleRequest" however that didn't seem to help.
Ad code in body:
<div id='div-gpt-ad-XXX-0' style='width:300px; height:250px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-XXX-0'); });
</script>
</div>
I worked this out.
jQuery.load was stripping the script tags from my html after loading it and DFP didn't like that. I ended up using https://github.com/coop182/jquery.dfp.js and it solved all the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With