• 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!

GameMaker How to Google ADS?

S

skullandbonesband

Guest
How to embed ads in your Android game using google? I use GAMEMAKER STUDIO 2 and resent. There's no information about it anywhere.
I think the original instructions are too much confuse, by trial and error I achieved to put a banner and interstitial ads.
Please substitute my ids for yours. Put this in an object in the first room of your game.

app_id = "ca-app-pub-5480497550115404~9133840133";
banner_id = "ca-app-pub-5480497550115404/6483626060";
bannerAdId = "ca-app-pub-5480497550115404/6483626060";
ads_app_id = "ca-app-pub-5480497550115404~9133840133";
interstitial_id = "ca-app-pub-5480497550115404/2130653368";
sizeType = GoogleMobileAds_Smart_Banner
GoogleMobileAds_Init(banner_id,app_id);
GoogleMobileAds_Init(interstitial_id, app_id);
use_test_ads=true;
deviceID="33bb9c18-8ecc-428a-becc-0c13cb4ae302"
GoogleMobileAds_UseTestAds(use_test_ads, deviceID);
GoogleMobileAds_LoadInterstitial();
GoogleMobileAds_AddBanner(bannerAdId, GoogleMobileAds_Smart_Banner);

and in the transitions, (new level or after game-ending, to show interstitial , put this in an object in the intermediary room:
GoogleMobileAds_ShowInterstitial();

Oh, for final version set use_test_ads=false;
and remove the deviceId , that is for testing only (you can test on yours, just change that for yours.

But don't forget to set up your add mobs first as the instructions say, then you can use your IDs here.

It worked fine.
You're welcome.
Light and peace and happy new year.
 
Top