Currently I'm trying to setup the Google DFP ads for using a dynamic responsive frame. By this I want to create a banner ad which has a relation to the screen size rather than predefining a size such as 300x250 or 300x240.
The DFPBannerView should be able to take a custom CGRect as argument and the DFP lineitem should take the full size of the CGRect.
I tried this by the following techniques:
Creating a DFP ad unit with smart banner as primary size. This doesn't work because a lineitem in DFP requires a fixed size. Furthermore, the smart banner seems to be limited to 90 in height.
Creating a DFP ad unit with the out of page as primary size. I didn't managed to get impressions on this ad unit.
Is there any way Google DFP can be setup for mobile banners to take the full size that is set?
Not sure if I understood correctly but I guess you will have to do something like this: https://www.monetizemore.com/blog/how-to-make-dfp-ad-units-responsive-2/
I used this example to add responsive units to my existing DFP calls.
Note that I don't used this top script of "var useSSL". I used what DFP gives me at unit creation.
I created 2 Ads unit and created 3 sizes that I needeed to each unit (728x90, 468x60 and 320x50). Mine calls for Adsense ads, but sure you can call your line itens.
After all and to be more direct as possible I just added:
While searching for examples to do this I found many tricky methods. But sincerely don't need nothing of that. I just did it work right now and this thread was one of the "answers" that I found looking for examples. Bookmarked this to help if I was able to do to my site. If I can, maybe I resume all code to make it work like:
That's it. With this code you have two responsive ad units calling DFP (Ads) Adsense banners with 3 sizes to 3 different resolutions.
And of course, in your HTML you'll have to call these DIVs like: