prebid / prebid-mobile-android

Prebid Mobile SDK for Android applications
Apache License 2.0
58 stars 84 forks source link

AdManager Adaptive banners not supported? #770

Closed przanBrainly closed 4 months ago

przanBrainly commented 5 months ago

We've implemented Prebid integration on Android following this guide: https://docs.prebid.org/prebid-mobile/pbm-api/android/android-sdk-integration-gam-original-api.html#banner-api

However, after changing regular AdManager banners to adaptive banners (https://developers.google.com/ad-manager/mobile-ads-sdk/android/banner/inline-adaptive) we get INVALID_SIZE error when calling fetchDemand because we create a BannerAdUnit with 0 height. And that's because AdSize for adaptive banners has 0 height, e.g. width=392, height=0, maxHeight=777.

Should I use maxHeight while creating BannerAdUnit then? Or adaptive banners are not handled by Prebid at all?

YuriyVelichkoPI commented 5 months ago

Hi @przanBrainly !

Prebid doesn't have the concept of adaptive sizes. Publishers should set all available sizes explicitly. All these sizes will be used in the auction. And of course, the banner with size 0 doesn't make sense for bidders.

On switching to adaptive GAM banners you shouldn't change anything in Prebid SDK setup except adding other ad sizes that make sense for your layout.

For instance. If an ad unit had a fixed size 320x50 and you switched to adaptive banners in order to support 320x100 in the same place in your app, you just should add 320x100 size using BanerAdUnit's method addAdditionalSize. As a result, the bid request to PBS will contain two sizes 320x50 and 320x100. Important: don't forget to use findPrebidCreativeSize function to resize the GMA SDK AdView respectively to the size of the Prebid's ad (for the details see the Step 6 in the giude)

Alternatively you can set ad sizes in the impression level stored request on the server.