Search code examples
google-dfp

Sync vs Async in DFP


I haven't signed up for DFP Premium yet, but I had a question about it.

If I choose to use asynchronous DFP tags on my site, what happens if my site loads a line item for an advertiser that only has synchronous tags? Will the DFP placement still load asynchronously? Will DFP try to 'convert' a sync tag to an async one? (I have heard of other adservers doing this...). Also, what happens if the advertiser tag contains document.write().... will it still work to put that advertiser in an asynchronous DFP setup?


Solution

  • You can use sync ad tags in an async DFP setup. DFP loads the ad tags in an iframe and the tags can run document.write() all they want.

    There are some drawbacks though. The iframes have a fixed size. If the sync tag renders a smaller creative, or no creative at all, then the ad unit still takes up the full size. You can work around this but that's kind of a nuisance, especially because the collapseEmptyDivs() method doesn't know if a third party tag has delivered a creative or not.

    Besides that you'll have problems with out of page creatives if they don't check if they are being rendered in an iframe. The DFP iframes are 'friendly iframes' by default, so it's extremely easy to escape them for a creative, but the creative does need some small modifications for this to work.

    But you can test all of this by trying the Small Business version of DFP. It's the exact same product with some advanced features (mostly related to targeting) disabled. Ad delivery is exactly the same when it comes to sync vs async.