Now that the Google Mobile Ads SDK is installed, it's time to configure your Unity project for Android and iOS.
Before writing any code, verify the following:
- Unity project created
- Google Mobile Ads SDK imported
- External Dependency Manager resolved
- Android Build Support installed
- iOS Build Support installed (if targeting iOS)
Open:
Edit → Project Settings → Player
Under Android:
- Company Name
- Product Name
- Package Name (Example: com.company.gamename)
- Minimum API Level (Recommended: API 24+)
- Target API Level (Latest Installed)
Select the iOS tab.
Configure:
- Bundle Identifier
- Version
- Build Number
- Target minimum iOS version
Google Mobile Ads requires an internet connection.
Unity automatically adds the required permission in most cases, but verify your Android Manifest if you've customized it.
Required permission:
<uses-permission android:name="android.permission.INTERNET"/>Open:
File → Build Settings
Select:
- Android
Click:
Switch Platform
Wait until Unity finishes converting the project.
If publishing for iPhone:
File → Build Settings
Select:
- iOS
Click:
Switch Platform
- IL2CPP
- ARM64
- .NET Standard 2.1
- IL2CPP
- ARM64
A correctly configured project should contain folders similar to:
Assets/
├── GoogleMobileAds/
├── Plugins/
├── Resources/
├── Scenes/
├── Scripts/
└── ExternalDependencyManager/
Create a folder named:
Assets/Scripts/Ads/
Later we'll add:
AdManager.cs
BannerAds.cs
InterstitialAds.cs
RewardedAds.cs
AppOpenAds.cs
Assets/
└── Scenes/
├── MainMenu
├── Gameplay
├── Loading
└── GameOver
- Keep all ad scripts in one folder.
- Use a single AdManager.
- Avoid duplicate initialization.
- Test with Google's test IDs before using production IDs.
- Keep Android and iOS App IDs separate.
➡️ Continue with:
Back to the README