2

HELP!!

I am in need of some example code on how to get an custom expanding ad to work in google DFP. Or just a simple example on how to call a javascript function on the parent page from DFP to expand the ad.

I know that enableSyncRendering(); loads the ads out of the iframe but then it take longer for the page to load since we have more then one ad on the page.

I have read from here, https://support.google.com/dfp_premium/answer/6023110?hl=en, that i can use safeframes and not have to do enableSyncRendering();. But every time i do the creative just loads into a 1x1 iframe from dfp and i cant bust out..

THANKS!!

B-rad
  • 186
  • 3
  • 16
  • Maybe you could try second example here: https://stackoverflow.com/questions/46144151/google-dfp-resize-safeframe-custom-creative-outer-iframe-container-from-inside/46144152#46144152 – PayteR Sep 10 '17 at 18:32

2 Answers2

3

All of the examples that are compatible with DFP are available here: http://publisherconsole.appspot.com/safeframe/creative-preview.html

I've managed to get the expansion working (I wanted push which isn't supported by DFP) so if you've followed the examples - I can only suggest that you're targeting a 1x1 advert and so that default advert size is 1x1 pixels.

The example page was a little difficult to follow at first -but you can literally just include the whole "Creative content" into a custom advert and it'll work as shown (as long as you set a 500x500 ad slot)

0

GPT should be loading the ad using a friendly iFrame. Try using parent.document to get parent's DOM.

UVray90
  • 13
  • 4