Android [SOLVED] AdMob Ads not showing

Dan1

Member
Hey everyone,

I'm struggling to get the banner and interstitial ads to show, for some reason nothing is happening when I attempt to run them.

I've set up the admobs account and have the following set up

Game start:
Code:
GoogleMobileAds_Init("ca-app-pub-XXX")
Create event in-game:
Code:
GoogleMobileAds_LoadInterstitial();
GoogleMobileAds_AddBannerAt("ca-app-pub-XXX",GoogleMobileAds_Banner,0,0)
Social event in-game (same object):
Code:
GoogleMobileAds_MoveBanner((abs(display_get_width()-GoogleMobileAds_BannerGetWidth()))/2, 0);
And just before you exit the level:
Code:
GoogleMobileAds_ShowInterstitial();
Android settings:


AdMob page:


And yet, nothing! No banner and no interstitial!

I'm not sure if I'm missing something obvious? Any help is appreciated! :)

Thanks,
Dan
 
Last edited:
H

Hrishi

Guest
Did you try with the test id? You do not want to use the admob id while testing as that might lead to your account been banned. (Requests from a single device)

GoogleTest Ad id for interstitial
ca-app-pub-3940256099942544/1033173712

Also are you testing the app after building the .apk and running it on the phone? The ads wont show up on the Test VM on your desktop. They only show up when the .apk is run on a phone.

Also check if you have Google Play services extension installed and activated.

https://help.yoyogames.com/hc/en-us/articles/216754558-Ads-Google-Mobile-Advertising-v1-3-
 

Dan1

Member
I have been testing it after building the APK and running it on my phone - I have a bit of trouble getting the test ads going as I've not been able to connect the phone with Gamemaker for some reason so I left test ads off but they just didn't show up at all - so test ads on or not you'd think something would show up?
 
A

Alex_Beach

Guest
Are you sure you are using the correct ad unit ID that is given to you on the individilual ads you made on AdMob? Also, make sure you check to see if the ad is loaded before calling to load them. The game has to load the ad into memory first and this can take about 2 to 5 seconds.
 

Dan1

Member
Ah I've got it sorted now, I've updated everything on the SDK manager, updated Java and it's just started working - not sure what it was that fixed it but it's all okay now :)
 
U

Uberpink

Guest
EDIT: (probably because i use newer ekstension, old ekstension needed only one afaik)

nice posts. i have a question to u pros... im using this line with my admob code (ok, should use the testcode,but..) trying interstitial ad

GoogleMobileAds_Init("ca-app-pub-9235698069544896/3211054688");

but it is red, like it has some errors, and ofcourse compiling then doesent work.... why is it red? others using that line without problem,, i have added the googleplay services in the ekstensions also ingame (but do it have to be activated or something?).....
 
Last edited by a moderator:
Top