Disabling DFP / DoubleClick iFrames

In Google DFP (DoubleClick), you are given an ad code to enter in your headline and another for your body. When I apply this tag / ad code to my website, whether its asynchronous or synchronous ad is always displayed inside the iframe. I am wondering how I will disable iFrame.

Here is the generated header code via DFP:

<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('/16569348/ad-test-1', [400, 267], 'div-gpt-ad-1362958263281- 0').addService(googletag.pubads()); googletag.pubads().enableSingleRequest(); googletag.enableServices(); }); </script> 

Here is the generated body code via DFP:

 <!-- ad-test-1 --> <div id='div-gpt-ad-1362958263281-0' style='width:400px; height:267px;'> <script type='text/javascript'> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1362958263281-0'); }); </script> </div> 

Here is a jsFiddle demonstrating this problem (check the element in google chrome to see iframe):

http://jsfiddle.net/EptwH/

Again, I would like to remove the iframe (and save the image / ad, of course) ... any help would really be appreciated. :)

+6
source share
4 answers

On the DFP website: link

When you use Google Publisher Tags (GPT), your ads will automatically load in iframes.

+5
source

Google uploads its ads to iframes on purpose, this is by design.

This is because it allows your page to load faster and have styles and scripts with a sandbox, etc. Page editing is faster because iframes allow asynchronous loading and rendering of advertising content.

You can "throw" out the iframe with your ad code if you want, so there is no real lack of ads in the iframe, show us an example of what you are trying to do if you have a problem

Here are some more indications to do this.

+1
source

We had the same problem because our goal was to add our own ads directly to the DOM homepage, not IFRAME, in order to get full responsiveness. We came up with a solution in which we publish an ad content line on the main page using messages. Thus, there is no longer an IFRAME.

See http://insights.burda-studios.de/howto-run-fully-responsive-doubleclick-native-ads-without-iframes/ for details

Please note that we only use home ads using this approach, not third-party ads, which can lead to unexpected behavior.

0
source

Part of your question (whether asynchronous or synchronous) is wrong in my experience. Not sure if this has changed or if you were unable to run the GPT tags synchronously, but since I switched to synchronous mode, iframes are no longer used. See for yourself at belmodo.tv

-1
source

All Articles