This guide is intended for publishers who want to monetize a Unity app.
Integrating the Google Mobile Ads Unity plugin into an app, which you will dohere, is the first step toward displaying AdMob ads and earning revenue. Oncethe integration is complete, you can choose an ad format (such as native orrewarded video) to get detailed implementation steps.
Prerequisites
Oh, and don't forget that Unity is free and we have fully-functional 30-day trials available for Unity Pro and Unity iOS Pro! ACCESS the FULL COURSE here: everyone, this video's gonna show yo.
- Use Unity 5.6 or higher
- To deploy to iOS
- Xcode 12 or higher
- To deploy to Android
- Google Play Services 18.1.0 or higher
- Target Android API level 14 or higher
- Recommended: Create an AdMob accountand register an Android and/or iOS app
Download the Mobile Ads Unity plugin
Version: 2020.3. This page details the Player settings specific to iOS Apple’s mobile operating system. More info See in Glossary. For a description of general Player settings that apply to all platforms, see Player - General settings. Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
The Google Mobile Ads Unity plugin enables Unity developers to easily serveGoogle Mobile Ads on Android and iOS apps without having to write Java orObjective-C code. The plugin provides a C# interface for requesting ads thatis used by C# scripts in your Unity project.
Use the links below to download the Unity package for the plugin or to take alook at its code on GitHub.
For easier ads integration using the Unity Editor, try the new Ad Placements Beta.
Import the Mobile Ads Unity plugin
Open your project in the Unity editor. Select Assets > Import Package >Custom Package and find the GoogleMobileAdsPlugin.unitypackage
file youdownloaded.
Make sure all of the files are selected and click Import.
Include the Mobile Ads SDK
The Google Mobile Ads Unity plugin is distributed with the Unity Play ServicesResolver library.This library is intended for use by any Unity plugin that requires access toAndroid specific libraries (e.g., AARs) or iOS CocoaPods. It provides Unityplugins the ability to declare dependencies, which are then automaticallyresolved and copied into your Unity project.
Follow the steps listed below to ensure your project includes the Mobile Ads SDK.
Android
In the Unity editor, select Assets > External Dependency Manager > AndroidResolver > Resolve. The Unity External Dependency Manager library willcopy the declared dependencies into the Assets/Plugins/Android
directoryof your Unity app.
Unity Ios Games
Note: The Google Mobile Ads Unity plugin dependencies are listed inAssets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml
iOS
No additional steps are required to include the Mobile Ads SDK into theUnity project.
Note: iOS dependencies are identified using CocoaPods. CocoaPods is run as apost build process step.- When using Unity 5.6 and above, an xcworkspace is generated thatincludes the required dependency libraries. Use the generatedxcworkspace instead of the standard Xcode project.
- When using older versions of Unity, the dependencies are included insidethe standard Xcode project.
Set your AdMob app ID
In the Unity editor, select Assets > Google Mobile Ads > Settingsfrom the menu.
Enable AdMob by clicking Enabled checkbox under Google AdMob section.Then enter your Android and iOS AdMobapp ID in each field.
If your app uses Ad Manager instead of AdMob, enable Google Ad Managerby clicking Enabled checkbox under Google Ad Manager section.
Warning: This step is required as of Google Mobile Ads SDK forAndroid version 17.0.0 / iOS version 7.42.0.Leaving AdMob app ID empty results in a crash with the message:The Google Mobile Ads SDK was initialized incorrectly.
You should makethis change immediately.Initialize the Mobile Ads SDK
Before loading ads, have your app initialize the Mobile Ads SDK by callingMobileAds.Initialize()
This needs to be done only once, ideally at app launch.
MobileAds.initialize()
. If you need to obtain consent from usersin the European Economic Area (EEA), set any request-specific flags (such astagForChildDirectedTreatment
or tag_for_under_age_of_consent
), or otherwisetake action before loading ads, ensure you do so before initializing the MobileAds SDK.Here's an example of how to call Initialize()
within the Start()
methodof a script attached to a GameObject
:
If you are using mediation, you may wish to wait until the callback occursbefore loading ads, as this will ensure that all mediation adapters areinitialized.
Select an ad format
The Mobile Ads SDK is now included in your Unity app when deploying to eitherthe Android or iOS platform. You're now ready to implement an ad. AdMob offersa number of different ad formats, so you can choose the one that best fits youruser experience needs.
Banner
Banner ads are rectangular image or text ads that occupy a spot within an app'slayout. They stay on screen while users are interacting with the app, and canrefresh automatically after a certain period of time. If you're new to mobileadvertising, they're a great place to start.
Interstitial
Interstitials are full-screen ads that cover the interface of an app untilclosed by the user. They're best used at natural pauses in the flow of an app'sexecution, such as in between levels of a game or just after completing a task.
Native
Native is a component-based ad format that gives you the freedom to customizethe way assets such as headlines and calls to action are presented in theirapps. By choosing fonts, colors, and other details for yourself, you can createnatural, unobtrusive ad presentations that can add to a rich user experience.
Unity Ios C#
Rewarded
Rewarded video ads are full-screen video ads that users have the option ofwatching in full in exchange for in-app rewards.
Bring your game to life with Unity's industry-leading development tools. Successfully run your iOS games with cutting-edge solutions created to take advantage of the robust Apple ecosystem.
A proven solution for iOS
Create stunning, performant experiences backed by Unity, the platform chosen to create over half of the top 1,000 mobile games on the Apple App Store.
iOS 14 Resources
Prepare for the upcoming ad tracking changes in iOS 14 with Unity resources, features and content to help publishers and advertisers transition smoothly to a privacy-focused ad environment.
Universal Render Pipeline
The Universal Render Pipeline is a single-pass, forward-rendering pipeline using few draw calls. It’s optimized for high performance, especially on phones and tablets.
Leverage ARKit with AR Foundation
Develop your AR app once, then deploy it across multiple mobile and wearable devices with tools for photorealistic rendering, physics, device optimizations and more.
Learn to publish for iOS
Check out this Unity Learn tutorial for everything you need to know about creating an Xcode project for your iOS game.
Little Orpheus: Developing for Apple Arcade
In this deep dive into their development process, The Chinese Room shares lessons learned developing their first Apple Arcade title, Little Orpheus.
Unity Ios Sdk
Mobile game development
Unity Ios Plugin
Create, launch and operate your game with the leading game development platform for mobile.
Unity Ios Setup
Create, launch and operate your game with the leading game development platform for mobile. Battle-tested by games of all genres, it provides the bleeding-edge technology, monetization solutions and live-ops services that you need to ensure success.