How to load DoubleClick ads with dynamic content

I am trying to download Doubleclick ad tags to load with my dynamic content. I have a website that loads more content as it scrolls down, instead of going to the next page, returning to the page, etc. However, I was not able to get my ads, which I have on every second or third page to download.

Does anyone know how to do this?

Thanks.

change

Code in title:

<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 also tried removing the "enableSingleRequest", but 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> 
+8
javascript jquery dynamic-content ads google-dfp
source share
1 answer

I have dealt with this.

jQuery.load removed the script tags from my html after downloading it, but DFP did not like it. I ended up using https://github.com/coop182/jquery.dfp.js and solved the whole problem.

+2
source share

All Articles