• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Trouble with loading and/or showing interstitial ads. [SOLVED (sort of)]

I'm having trouble showing or loading interstitial ads for an android game.

I've got an object (obj_ad_controller) set as persistent and it gets created very early in the game. Splash screen early.
This is in its create event:
Code:
if os_type == os_ios
{
    /*
    app_id = "";
    banner_id = "";
    interstitial_id = "";
    rewarded_id = "";
    */
}
else
{
    app_id = [my_app_id];
    //banner_id = "";
    interstitial_id = [my_ad_id];
    //rewarded_id = "";
}

GoogleMobileAds_Init(interstitial_id, app_id);
GoogleMobileAds_LoadInterstitial();
interstitial_loaded = false;

GoogleMobileAds_UseTestAds(true, [my_test_id]);
And this is in the async social event:

Code:
var loaded = ds_map_find_value(async_load, "loaded");

if (loaded)
{
    interstitial_loaded = true;
}
I also tried this in the async social:

Code:
var _id = async_load[? "id"];

if (_id == GoogleMobileAds_ASyncEvent)
{
    var ident = async_load[? "type"];
  
    switch (ident)
    {
        case "interstitial_load":
      
        if (async_load[? "loaded"] == 1)
        {
            interstitial_loaded = true;
        }
      
        break;
    }
}
Later on when the player has cleared a level I send them to a room with some fireworks and a congratulatory message, upon screen touch I try to load an ad, for testing porpuses nothing else happens,t looks like this (in Left Released event):

Code:
if (obj_ad_controller.interstitial_loaded == true)
{
    obj_ad_controller.interstitial_loaded = false;
    GoogleMobileAds_ShowInterstitial();
}
But nothing happens at all. And on debugging I get interstitial_loaded as "0" so false. It never loads, what am I doing wrong?

What am I doing wrong? I mainly followed this guide: https://help.yoyogames.com/hc/en-us/articles/360002971751-iOS-and-Android-Google-Mobile-Ads-Setup

Oh yeah, stuff in "[]" are omitted here but they hold the right IDs and I got the first two off my AdMob console thingy.

EDIT:

I've now tried to add banner ads but get a 400 error, what is that? Also, it says that interstitial ad was not ready to be shown. How long should that take to load??
 
Last edited:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Your code looks okay, and is pretty much the same as what I have in my games so it would suggest that maybe you haven't set up the ad provider correctly, or haven't given it enough time to start working. If you've only set up AdMob in the last 24 hours it could be that the system just isn't serving ads yet. I normally have to wait anywhere between 24 and 48 hours to get ads after setting them up on the AdMob dashboard initially.
 
N

Nicolay

Guest
I have the same problem...whit ads, it doesnt load...
Adbanner not loaded:3
 
Your code looks okay, and is pretty much the same as what I have in my games so it would suggest that maybe you haven't set up the ad provider correctly, or haven't given it enough time to start working. If you've only set up AdMob in the last 24 hours it could be that the system just isn't serving ads yet. I normally have to wait anywhere between 24 and 48 hours to get ads after setting them up on the AdMob dashboard initially.
Yes, this was literally the solution. I had forgotten to click "ok" on my adress in admob and now, almost 24h later, it seems to work fine. Note to self, RTFM.
 
Top