Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Banner ad size on higher resolutions

Discussion in 'Unity Ads & User Acquisition' started by Jerhyn777, Jan 19, 2020.

Thread Status:
Not open for further replies.
  1. Jerhyn777

    Jerhyn777

    Joined:
    Nov 9, 2017
    Posts:
    7
    Hi, I'm having some trouble with a banner ad on my Android game. I think I have everything set up and can see it's adding something in the editor, but for higher resolutions it is barely visible (see screenshot, top middle is the banner ad, resolution is 1440x2560). What do I need to do to get it to show up better on higher resolutions? Thanks!
     

    Attached Files:

    • snip.PNG
      snip.PNG
      File size:
      5.7 KB
      Views:
      1,304
  2. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Banners will show up in two different sizes: 320x50 or 728x90. Which one gets picked depends on the device the ad is being shown on.

    The placeholder banner shown in the editor isn't necessarily accurate to how the banner will appear in a published app. If you test on a real device, you should see the larger banner size get used if the device is big enough to warrant it.
     
  3. Jerhyn777

    Jerhyn777

    Joined:
    Nov 9, 2017
    Posts:
    7
    Thank you for the reply. I've tried building to my phone and nothing shows up. Here is the coroutine I'm running:
    Code (CSharp):
    1. IEnumerator ShowBannerWhenReady()
    2.     {
    3.         while (!Advertisement.IsReady("Banner1"))
    4.         {
    5.             yield return new WaitForSeconds(0.5f);
    6.         }
    7.         LogInfo("banner ready");
    8.         Advertisement.Banner.SetPosition(BannerPosition.TOP_CENTER);
    9.         Advertisement.Banner.Show("Banner1");
    10.     }
    I see the log come through but I never see a banner, not even a small one. I double checked the banner ID also and it matches what I have in the dashboard. I am able to play video ads, so it seems like just an issue with the banner. Is there anything else I'm missing? Thanks!
     
  4. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Hmm, I can't see anything wrong there. Could you post the rest of your ads code? It could be an issue with how you're initializing the SDK. Are you using video ads as well?
     
  5. Jerhyn777

    Jerhyn777

    Joined:
    Nov 9, 2017
    Posts:
    7
    I am using video ads and haven't had any problems with them. I'm initializing by calling
    Code (CSharp):
    1.  
    2. Advertisement.Initialize("#######", false);
    3. StartCoroutine(ShowBannerWhenReady());
    4.  
    (where ###### is the ID on the Placements page for Google Play Store)
     
  6. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    That code looks fine too. If you keep having problems, you should get in touch with our support email - send an apk build of your game or the full project itself and we can have a look for you.

    unityads-support@unity3d.com
     
  7. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    For the benefit of anyone finding this thread via Google or other means, here's some info about what the problem ended up being.

    When loading the Unity Ads SDK in production mode, running your app on a device will attempt to load live ads. However, it's possible that there are no valid ads available to load from the server. If there are no ads available, then the SDK will return a "no fill" error, and no ad will appear.

    So in this situation there was no error in the original poster's ads integration, and the "no fill" situation was what was causing the banner to not appear.
     
  8. pablo_leban

    pablo_leban

    Joined:
    Sep 19, 2013
    Posts:
    68
    And what does it checks from the device to choose either 320x50 or the 728x90? The resolution? The OS version? Cause im trying two different phones, both 2160x1080, and one banner is full width and the other one doesn't.
     
  9. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    @pablo_leban The size of the banner is determined by the device: phones should get 320x50 and tablets should get 728x90. Which phones are you using?
     
    mbhagat and WaqasGameDev like this.
  10. raphaelcom1

    raphaelcom1

    Joined:
    Oct 24, 2020
    Posts:
    1
    I think thats the same thing with my app, too. Did I get it right that as soon as there are valid ads available they should show in the banner. Or do I have to reload/rebuild or completely reinstall the SDK to see banner ads in my app?
    When I tried to use banner ads in testmode the banner worked.
     
  11. WaqasGameDev

    WaqasGameDev

    Joined:
    Apr 17, 2020
    Posts:
    118
    This should be explained in the official docs too because banner ad directly interferes with UI and to know what size to expect is very crucial but official docs are silent in this regard. Kindly make it clear there as well. Thanks.
     
    bbxlegend, dmitry_kr and w0lfi like this.
Thread Status:
Not open for further replies.