prebid / prebid-mobile-ios

Prebid Mobile SDK for iOS applications
Apache License 2.0
47 stars 88 forks source link

[AdManager][Banner] An ad is not rendered properly #175

Closed yoalex5 closed 5 years ago

yoalex5 commented 5 years ago

Type of issue

Bug

Description

When running a standard banner adunit it is not rendered by AdManager SDK.

Steps to reproduce

1 - Follow the Guide to DFP setup 2 - Make a Code Integration for iOS 3 - Setup BannerAdUnit for Google Mobile Ads 4 - Run and check the result. When a banner ad is returned, the rendering fails.

Test config

Host = Appnexus ServerAccountId = "bfa84af2-bd16-4d35-96ad-31c6bb888df0" configId = "6ace8c7d-88c0-4623-8117-75bc3f0a2e45" adUnitID = /5300653/test_adunit_pavliuchyk_300x250_puc_ucTagData_prebid-server.rubiconproject.com

Charles log: ios_Pv1.0_AMv7.42.2_prod_appnexus_rubicon-puc_ucTagData.chls.zip

Expected results

If AdManager response contains an ad it should be rendered

Actual results

A creative is not showed

Platform details

Prebid SDK v 1.0, git hash: beeee28699c268d021a7ad612ec6d60e64624f30 AdManager v 7.42.2

Other information

AntoineJac commented 5 years ago

I am confirming the issue, the GADBannerView has the correct size but the GADWebAdView is keeping the 1x1 size. The "x-afma-ad-size" header used by the SDK to build the GADWebAdView, this header field is returning 1x1 instead of the real creative size. The other header "X-Afma-Ad-Slot-Size" has the correct size. It is an issue with the DFP SDK and I raised it to google a few week ago.

I have found a fix using the mraid.resize() in the prebid creative but hope Google could fix it...

bszekely1 commented 5 years ago

To add additional details to the issue, Oleksandr who created this ticket has done some analysis on which versions of the Google ads SDK exhibit the failure to resize below. Fields in orange show failure.

Screen Shot 2019-04-05 at 3 09 12 PM Screen Shot 2019-04-05 at 3 09 21 PM

Oleksandr and I are recommending we add some logic in the universal creative (possibly with MRAID or pure JS) to resize the ad slot to the dimensions of the creative being served in SDK environments.

Is anyone else able to validate this to be an issue?

bszekely1 commented 5 years ago

This issue was posted in a Google Forum support page here: Google Groups

If this issue can be validated by others, I would like to get momentum behind the google support post to encourage Google to address the issue. If anyone is able to provide additional details, please post both here and the Google ticket.

yoalex5 commented 5 years ago

As a variant of solution that should be implemented from a publisher side it is using resize approach

iOS DFPBannerView.resize() function in GADBannerViewDelegate.adViewDidReceiveAd()

For example

func adViewDidReceiveAd(_ bannerView: GADBannerView) {
    print("adViewDidReceiveAd")

    self.dfpBanner.resize(bannerView.adSize)
}

Android PublisherAdView.setAdSizes() function in AdListener.onAdLoaded()

For Example

dfpAdView.setAdListener(new AdListener() {
    @Override
    public void onAdLoaded() {
        super.onAdLoaded();

        dfpAdView.setAdSizes(dfpAdView.getAdSize());
    }
});

Do not use this approach with multi-size adunit

ppuviarasu commented 5 years ago

This needs to be documented here http://prebid.org/prebid-mobile/pbm-api/ios/pbm-bannerad-ios.html && http://prebid.org/prebid-mobile/pbm-api/android/banneradunit-android.html to include adManager and the implementation logics like these to address specific mediation partner issues

AntoineJac commented 5 years ago

I have run some tests on iOS and Android for different SDK version and seems to work well. This solution seems to be the simplest and easy to setup. Methods used to resize are officially supported and part of Google api doc so it is also safe to go but will need to be removed when Google confirm the issue is fixed!

bszekely1 commented 5 years ago

Released in 1.1.1