Google Mobile Ads SDK — Getting Started
Provides instructions for integrating the Google Mobile Ads (GMA) SDK for AdMob or Ad Manager in Android, iOS, or Unity applications.
Implementation Steps
- Determine platform (Android / iOS / Unity)
- Add the SDK dependency
- Set the application identifier
- Initialize the SDK
- Verify the integration
- Select an ad format to continue
Code Example (Android — build.gradle.kts)
dependencies {
implementation("com.google.android.gms:play-services-ads:23.0.0")
}
Code Example (iOS — CocoaPods)
pod 'Google-Mobile-Ads-SDK'
Code Example (Initialization — Android)
import com.google.android.gms.ads.MobileAds
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
MobileAds.initialize(this) { }
}
}
Common Pitfalls
- Missing app ID: Add
com.google.android.gms.ads.APPLICATION_IDmeta-data in AndroidManifest.xml - SDK not initialized: Call
MobileAds.initialize()before loading any ads - Wrong platform guide: Android, iOS, and Unity have different setup steps — follow the correct one
Verification Checklist
- SDK dependency added to build file
- Application ID configured in manifest / Info.plist
- SDK initialization code added
- Build succeeds without errors
- Ad format selected for next steps