3

recently I have decided to ad google admob banners to the game. I have followed every step by the guide and added our ad-unit-id too. So everything is ok and cool, but suddenly the banner becomes larger and is showing video at about thrice (or even bigger) the size of the banner itself.

I'm using unity 2020.1.13 and I have tested different banner sizes as admob guide suggesting (SmartBanner, AdaptiveBanner, (default small) Banner ,... ) everything. but it keeps punching me in the face each time. The following images are the normal size(which I expect it to remain) and the larger version that happens 2-3 times out of 10.

Normal size After loaded video size
Normal Size (expected to remain like this) Bigger size wit video

The code requesting the banner is:

    public void RequestBanner(string unitID)
{
    

    // Clean up banner ad before creating a new one.
    if (this.bannerViewAd != null)
    {
        Debug.Log("|||| Prev Banner removed!");
        this.bannerViewAd.Destroy();
    }
    
    AdSize adaptiveSize =
        AdSize.GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth(AdSize.FullWidth);
    
    
    // Create a 320x50 banner at the top of the screen.
    this.bannerViewAd = new BannerView(unitID, adaptiveSize, AdPosition.Bottom);
    
    // Called when an ad request has successfully loaded.
    this.bannerViewAd.OnAdLoaded += this.HandleOnAdLoaded;
    // Called when an ad request failed to load.
    this.bannerViewAd.OnAdFailedToLoad += this.HandleOnAdFailedToLoad;
    // Called when an ad is clicked.
    this.bannerViewAd.OnAdOpening += this.HandleOnAdOpened;
    // Called when the user returned from the app after an ad click.
    this.bannerViewAd.OnAdClosed += this.HandleOnAdClosed;
    // Called when the ad click caused the user to leave the application.
    this.bannerViewAd.OnAdLeavingApplication += this.HandleOnAdLeavingApplication;
    
    // Create an empty ad request.
    AdRequest adRequest = new AdRequest.Builder().Build();
    
    // Load the banner with the request.
    this.bannerViewAd.LoadAd(adRequest);
}

in the code u are seeing adaptivesize and constantSize , I tested both and came up with the same result, also I tested smart banner and same result too.

  • This is happening to my native Android app too. The adSize is set using a method in the AdMob SDK "AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize()" here's the expected ad banner size: https://ibb.co/L1dh971 here are the screenshots of the bug: half screen block: https://ibb.co/kJkBzGd full screen block: https://ibb.co/1snkTh5 – Noel Chew Jan 29 '21 at 10:48
  • @NoelChew I have also opened this issue on the admob package repository in github, the following link will redirect to the issue. After days searching for a solution, we gave up the video banners to stop this problem. https://github.com/googleads/googleads-mobile-unity/issues/1557 – Ali Paknahad Jan 31 '21 at 12:17

1 Answers1

1

Until now I could not find any solution for this, even after contacting admob support they refused to answer me.

So for you guys using admob banner ads, seems like you mustn't use video banner

  • I see this happening to our website as well. A 320x50 ad slot is now 100% of the width of the phone and it keeps the dimension ratio, causing the height to be taller affecting CLS among other things with our sticky header logic. Complete pain in the butt trying to prevent this, I hope this doesn't become a trend. – Scott L Aug 04 '21 at 21:27
  • @ScottLeonard Yes, I know. It is really painful. The issue on admob GitHub is still open after more than 6 months. Unbelievable support – Ali Paknahad Aug 07 '21 at 12:08
  • I'm facing the same issue either for almost 5 months now on Android Studio. – Regex Aug 07 '21 at 13:17