Create Ad Units

To create an ad unit, you first need to select an ad format. The ad format determines how the ads will appear in your game. Four different ad formats are available:

images/UsingAdsToIncreaseRevenue/ads-ad-formats-alt.png
  • Banner: A basic rectangular ad that typically appears at the top or bottom of the device screen.

  • Interstitial: This is a full-page ad that supports video and appears during natural breaks and transitions, such as level completion.

  • Rewarded: This format rewards players for watching short videos and interacting with playable ads and surveys.

  • Native advanced: You can use this customizable ad format to match the look and feel of your game.

Deciding which ad format to use depends largely on the design of your game. For example, you likely wouldn’t use interstitial ads if your game didn’t have distinct levels, or rewarded ads if you had nothing valuable to offer.

In this book, you’ll work with two ad formats: banner and rewarded.

Creating an Ad Unit for Banner Ads

To create an ad unit for banner ads, select the Banner ad format and enter the required information, such as the ad unit name and the ad format, which you already selected. For the Ad unit name enter “Banner Ad Unit” as shown in the image.

images/UsingAdsToIncreaseRevenue/ads-create-ad-unit-settings-banner.png

Expand the Advanced settings section. Here, you can set up the refresh options and whether or not to define a custom eCPM floor. The eCPM is the cost per mile or the ad revenue generated per 1,000 ad impressions. For more information, see the AdMob documentation.[59]

For this example, you’ll stick with the default settings, as shown here:

images/UsingAdsToIncreaseRevenue/ads-create-ad-unit-adv-settings-banner.png

If you’re curious about what each setting does, click the question mark icon next to each setting to see a small pop-up that explains things:

images/UsingAdsToIncreaseRevenue/ads-create-ad-unit-question.png

With all of the settings in place, click the CREATE AD UNIT button. If everything went according to plan, you’ll see something like this:

images/UsingAdsToIncreaseRevenue/ads-banner-ad-unit-created-banner.png

To finish setting up this ad unit, click either the DONE button or the CREATE ANOTHER AD UNIT link. (Heads-up: you’ll be making another ad unit, so click the link.)

At this point, your ad unit is ready for use. However, before moving on to integrating this ad unit into your game, you’ll first set up another ad unit to handle rewarded ads.

Creating an Ad Unit for Rewarded Ads

To create an ad unit for rewarded ads, select the Rewarded ad format. As before, you’ll need to provide an ad unit name. You’ll also need to set up the reward settings. In other words, you’ll define what players will receive when they watch the ad.

Enter “Rewarded Ad Unit” for the Ad unit name, the number “1” for the reward amount, and the word “Continue” for the reward item, as shown in the image.

images/UsingAdsToIncreaseRevenue/ads-create-ad-unit-settings-rewarded.png

When checked, the Apply to all networks in Mediation groups option lets you serve ads from multiple sources, including the AdMob Network, third-party ad networks, and AdMob campaigns. You can keep this option enabled (which is the default setting), but this book does not cover using multiple sources or other networks.

Click the Advanced settings link. Notice the rewarded ads have a different set of options, as you can see in the following image:

images/UsingAdsToIncreaseRevenue/ads-create-ad-unit-adv-settings-rewarded.png

If you’re curious about a setting, click the question mark icon next to the setting to learn more about it.

After confirming all of the ad unit settings, click the CREATE AD UNIT button and you’ll receive the following confirmation:

images/UsingAdsToIncreaseRevenue/ads-banner-ad-unit-created-rewarded.png

Click the DONE button and you’ll see the main Ad units page, which looks something like this:

images/UsingAdsToIncreaseRevenue/ads-ad-units-list.png

Before moving on, it’s important to understand how to test ads while you’re developing your game without getting your account flagged for suspicious activity.

Using Test Ad Units

While your game is in development and you’re testing your code, Google encourages you to use test ads. You can use test ads in two ways:

  • Use Google’s sample ad units.
  • Use your own ad units and enable test devices, which gives you more flexibility for testing—especially with rewarded ads.

The current sample ad unit IDs are as follows:

images/UsingAdsToIncreaseRevenue/ads-test-ad-unit-ids.png

You’ll see these IDs used throughout the code examples in this book. You’ll also see the test App ID, ca-app-pub-3940256099942544~1458002511. Google provides this ID to experiment with the SDK.

You can either use these test IDs or the ones you create with your account—provided you follow Google’s recommendations for testing with your own IDs.

For more information about testing and using test ads, please refer to Google’s online documentation, specifically the Test Ads section.[60]

With your AdMob app ID and ad unit IDs set up, the next step is to download the Google Mobile Ads SDK and integrate it with your Xcode project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.91.51