(Please note: This tutorial was written before extensions were required for advertising in Game Maker Studio, and thus is outdated. The relatively simple method for setting up advertising in newer versions of GMS with extensions can be found at this very handy link I came across!: http://help.yoyogames.com/entries/24461331-Ads-Google-Mobile-Advertising-v1-3- )
Last night I finally sat down and did what I’ve needed to do for weeks – take a dive into the approach and methods of mobile app in-game advertising. And I can now reassuringly say that in-app advertising isn’t quite as scary (or complicated) as it seems!
Now, don’t quote me on any of this, because the only ad distribution platform I’ve experimented with so far has been the Google AdSense/AdWords/AdMob combination. I’m not certain how much of this information is relevant to other digital advertisement networks, but I’m assuming most of it would carry over from one to the other. I’ll be speaking purely in terms of AdMob/Game Maker: Studio/Android though.
The basic idea behind in-game advertising? First, you sign up for an account with AdMob, which also requires registered AdSense/AdWords accounts, (during AdMob registration, you’ll be prompted to create these if you don’t have either set up). AdSense and AdWords are two of Google’s powerful advertising services which help to create ads and target the most logical audience. Next, add an app name to your AdMob account which will host the advertisements. If the app isn’t up on the the PlayStore yet, no worries, you can just use a placeholder name and no link for now. Next, you determine the type of advertisement you’d like to place in your app – banner or interstitial. A banner ad is just as it sounds – a short, wide rectangle that can be overlaid in any position on the screen. Interstitial ads are fullscreen advertisements that require user input (to either click the ad, or cancel out). You can select the advertisement colors and assign a name (eg. Top Home Banner).
Finally, you’ll recieve a unique Ad ID code which references this particular ad. This is very important, as this code is basically the link between your app and the AdMob network, allowing them to speak and communicate with each other.
Once that’s all set up, back in Game Maker Studio under the advertising tab in (Global Game??) settings, choose AdMob as your android advertisement platform and check “Enable Ads”. Make sure “Use Test Ads” is disabled at the moment (we’ll enable that in the next step).You’ll notice a few empty fields underneath, each labeled “Key” and a number. This is where you can paste your individual Ad ID codes. For now, we just have the single one from the ad we created, so paste that in the “Key0” field. I’m not at my computer at the moment, but the format of the code should be some text (something like ca-pub- or something) followed by a bunch of random digits and letters. You’ll notice there’s another empty field near the bottom, Device ID. We’ll need to fill this in with an appropriate value, here’s how:
Connect your Android device via USB and, with Android set as the target device, test run your project. In the adb window that pops up (the MS-DOS command prompt-looking window that launches after GMS compiles your program), you’ll notice a line near the bottom that gives a unique code in quotes (the text preceding that line should read something to the effect that you need to use that code in your AdMob application. I can’t remember the exact text though). Copy the code to the clipboard by right clicking >> marking, highlighting the code, then hitting enter. Paste this code in the Device ID field in Game Maker Studio at the bottom of the Advertising tab settings for Android. You can now enable “Test Ads” by checking the appropriate box.
Lastly, we have to actually enable and specify the position of the ad in the room. Create an object, and in the create event, write the following line of code:
The first argument is the x position, second argument is y position, and third argument is which ad you’d like to enable (which “key”, and as we pasted our code in key0, we would thus enable ad 0).
And you’re good to go! Test compile your game again, and you’ll now notice a blue box that represents the position and dimensions of your ad. If you’d like to see what your ad really looks like with real advertisements, just uncheck the “Use Test Ads” box.
Just a couple things to note. First, be very aware of the terms and guidelines for using AdMob/AdSense/AdWords. Most of it is common sense, like never pairing ads with illegal, crude, discriminatory, violent content, ensuring that the ad is clearly separate from the game, not misleading the player to click it in any means whatsoever, etc. You have to make sure to never EVER click your ad! EVER. I’ve heard many horror stories about accidentally clicking your ad, and having your AdMob account terminated. This is because every click, of course, should be representative of a consumer taking interest in an ad, clicking it, and thus generating revenue for you, the app developer. If you click on it yourself, that’s basically stealing money. So don’t do it, bad man.
One other thing I’d like to touch on real quick. Be aware of where and when to position ads. Each ad type has a set width and height in pixels, and this can cause some major frustration running the same app with advertisements on devices with different resolutions. If, for example, your ad covers a width of 300 pixels and you run it on a Nexus 7, it’ll take up just a little space. Run it on a low resolution phone though, and the ad covers a significant portion of the screen, possibly even blocking gameplay elements. The ad is NOT resized appropriately to the resolution of the device displaying it. If the ad is 300 pixels, then no matter what device you run it on, gosh darn it, it’ll take up all of those 300 pixels. How do we work around this?
I haven’t experimented yet, but I’d assume the best case is – place ads in positions where they can’t mess up! Far away from buttons, areas of the screen where users would never touch, places that wouldn’t look distracting, a distance from important menu elements and graphics, etc. This doesn’t always necessarily guarantee 100% compatibility on all devices, but you need to aim for the majority of the market, and the tiny list of devices that would encounter problems? You can check their resolution, then literally adjust menu and ad positions ingame to accommodate for differing resolutions.
And finally, when and where to display ads? Anywhere you’d like, so long as it doesn’t detract from gameplay! The most common areas for a banner seem to be on title screens and all menus, and in some cases, in gameplay too (but title screen/menus combination for banners seems to ring true to the majority of apps). Mostly, the ad is centered on the x axis, and at the very top or bottom of the screen on the y axis. And Interstitial ads? If your game includes longer levels, then after every couple of levels is fine, but if your app has you switching between levels every 15 seconds, you might want to hold off and instead display an interstitial ad in a timed interval (eg. every 90 seconds).
A good rule to follow when deciding where to place ads? Get your information across, but just don’t be a jerk about it (I was enjoying a game earlier, but I just could NOT continue playing, when each round lasted 20 seconds, and I’d be greeted with a 5 second fullscreen interstitial ad after every single round. No thanks!)
Hope this helped! The AdMob setup information might be slightly off, as I’m still new and I wrote that from my hazy memory. I’ll be sure to update as I come across more advertising opportunities and tips!