AdMob banners move the screen

Hello,
I tried to add admob to my app but when the banner loads, the screen gets pushed up
I believe this is an error and the intended behavior is to render on top of the game

ddf71fa1d1770c0615a045370024eb8d1502add3_2_690x388

I summarized my problem, hopefully it can get reviewed now

Hey Ralph. Did you try changing the Y of camera set to scenewindowheght/2 after the action that pushes the screen up?

1 Like

Hi, Lucky, thanks for replying!
I’ve been trying to fix this issue for over 2 weeks now, I did try the solution you suggest but it didn’t seem to do anything, here’s how I did it, in case I did something wrong

1 Like

I’m facing the same problem and taking advantage of the topic created, I would like to know if anyone can help. When I configure the banner at the beginning of the scene, even specifying that it should only appear at certain moments in the game, like during Game Over, it appears on the main screen of the game. I follow the “banner is configured” setting for that specific moment precisely, but the banner keeps showing up, positioning itself above or below as instructed, but without being called! This displaces the screen, as mentioned, and becomes visible during gameplay, disrupting the player’s experience. Does anyone know how to fix this?

2 Likes

Your problem should be an easy fix. In the first scene of the game, use a beg of scene condition to check if a banner ad is configured inverted and action configure banner ad. If you don’t want it showing in that scene, use action hide banner ad in beg of scene events. Also hide it in beg scene events of any other scene you don’t want it showing in that the player can get to from the scene where it was showing. In the scene you want the banner showing, use beg of scene event show banner ad.

I’m assuming it can be hidden or shown specifically with variables as you are doing too. So not sure what’s happening there, unless you are not hiding it again later.

Nope buddy that was my best guess at doing something simple because I gathered you had a lot of scenes to change if we can’t get it solved and I was trying to think of something to avoid all that.

I tried messing around with it just now to see if I could think of something else, but haven’t been able to replicate the pushing up of the screen. I think the dimensions of my test project are too small. I put the resize height like you did (in properties??) but because my dimensions are probably too small, the banner ad isn’t doing anything but cutting out some of the useless screen at the bottom that didn’t show the game anyway (just the default scene background color). What dimension is your game? I did 720/1280.

I did 720x1280 as well, and yes, with resolution resize mode set to height in the game properties panel, because when I do width, while the screen does not get pushed up, it gets shrunken and a margin appears on the right side
image
with “update resolution during the game” enabled

Here is the behaviors I’m using to show the banner
image

I do have many scenes but I’ve been trying to fix this for so long that I’ve figured no ads are shown on the others, I just need to fix this one which is the main menu

In your test project, what happens when the ad is shown, does it actually render on top of the game?

This may not make sense but I just noticed it does not happen the first time I open the app after installing,
the first time, it displays correctly on top of the game,


But as soon as I either change scenes and go back to this one or reopen the app, the issue appears

Oh whoa. Now that’s odd. Mine always seem to not overlap the game content, but do the adaptive resize, whether I am using test ads or an actual ad unit.

Hold on I’m going to rebuild with size set to 720/1560 (dimension of the device I’m using) and see what happens. My device is just too long for it to do the push up action when the banner is shown.

Still no love, buddy. Even building for the exact length of my screen, which I expected to push up after the ad loaded, did not work. The game started, and I know the ad did an adaptive resize, not overlay, because the gdevelop/luckyj thing clearly got put in a higher position. But the rest of the game didn’t get pushed up. Even changing scenes and going back, reopening the game etc.

What are the dimensions of your device? Maybe it’s the width I need to make bigger or smaller to get it to push up when the banner loads.

Also do you have any sizing actions in your actual events?

EDIT:

Great news for you, I hope. I got it figured out. I placed some objects in the bottom of the screen and rebuilt the app. When the banner loaded, even though it looked like it was doing adaptive resizing (the black “shadow” where the banner was about to appear, gdevelop/luckyj going higher up, etc) it actually did an overlay of the game. All the objects I placed in the bottom in the different scenes were covered by the banner.

Ok so I am using an actual AdMob banner ad unit from my account. The first build I was using a test ad from the action in GDevelop, but the screen did not push up and I assumed you were using an ad unit so I switched to one of my ad units for the rest of my builds to try to get the push up result.

So this almost makes me think only the test ads disfigure the game?? Which is odd because I have played other games where the banner ad clearly resizes the game. But anyway I wanted to let you know to try it with an ad unit instead of the test banners and see if that doesn’t solve your problem. You can easily add your device as a testing device if you are worried about clicking your own ads.

Opening scene events.

I went through the whole project,
couldn’t find anything even related to scaling that may have been causing this

What I did find is that I could’ve put the banner on top,
since the screen getting pushed down instead wouldn’t cause anything to cut, I have nothing on the bottom
Right?
Wrong, I’ve been wrong about the issue this whole time, I’ve figured what’s happening here is not that the screen is getting pushed up but rather the way GDevelop is handling scaling resizing the scene, cuts both in top and bottom of the screen, that’s why the space the top of the screen is losing when the banner loads is not the same as the banner height but half of it, the other half gets cut on the bottom

This still doesn’t give me an idea on how to fix the problem,
but thought it could be helpful to mention

My device’s display is 1080x2160
I’m not sure what you mean by not using test banners, could you be more specific? I believe I’m using ad units like you said

I don’t see a major difference on my beginning of the scene events but here they are once again in case I’m missing something, all I see is that I didn’t add the banner is not configured condition like you have, I will try with it and tell you
image

Ok that makes more sense, if it’s being cut from the top and bottom. I never would have thought of that, I thought it only resized from the right or bottom, and that home would always be 0,0. I think if you can figure this out it will be helpful to a lot of people.

My mistake, the banners served to my test devices are usually sports cars and they are about half the size of your banner so I thought you must be using the number they give you to run test ads.

I can’t think that one condition would cause your game to react like that. I just don’t know why yours is resizing and mine is overlay.

1 Like

I still appreciate the effort,
Will keep trying to figure this out, at least I know all I need is a way to return the Y coordinate where the scene meets the top of the screen so I can subtract it from the camera.

08e99d658631ea20fd6dc6d86c7eb7e0a6947458_2_250x500