2

I experience some difficulty with google DFP with safeFrame, let me explain

I need to make an expandable ad, and i manage to do it with safeframe but when the user doesn't scroll enought, ad don't want to expand because $sf.ext.geom() limit depend of position of ad in user window.

Is there a way to force this expand from my main frame ?

Here my code :

$sf.ext.register(width, height);

function expand()
{ 
    var expandHeight = Math.min(img.height - height, maxHeight);
    var config = {push: true,t: 0,l: 0,r: 0,b: expandHeight};
    $sf.ext.expand(config);
};
function collapse(){
    $sf.ext.collapse();
};
ekans
  • 1,662
  • 14
  • 25
  • 1
    try my workaround example here https://stackoverflow.com/questions/38849451/is-there-a-way-to-expand-an-advert-outside-of-the-window-width-within-a-gpt-goo/46120910#46120910 – PayteR Sep 08 '17 at 17:17
  • 1
    i came up with second, better solution 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:36
  • Yeah, i end up by coding my own post message function, thanks for the help ! – ekans Sep 11 '17 at 08:31

0 Answers0