Google Mobile Ads Banner
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Software development
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow for integrating Google Mobile Ads (GMA) banner ads into mobile applications. It covers the setup process for Android, iOS, and Unity platforms, focusing on defining ad views, configuring adaptive ad sizes, and managing ad load events. The skill emphasizes the use of Large Anchored Adaptive Banners as the default standard and provides platform-specific guidance for handling ad requests and verifying implementation builds.
What it does
- Identifies the target mobile platform (Android, iOS, or Unity).
- Provides specific implementation steps for banner ad views and sizes.
- Recommends Large Anchored Adaptive Banners as the default ad format.
- Guides the registration of ad load event callbacks.
- Includes platform-specific verification steps to ensure successful builds.
- Reminds users to swap test ad unit IDs for production IDs.
When to use it
- When you need to integrate banner ads into an Android, iOS, or Unity app.
- When you are setting up adaptive banner layouts for mobile screens.
- When you need to troubleshoot the initial configuration of a banner ad view.
- When you require specific guidance on using the Google Mobile Ads SDK for banner formats.
Advantages
- Standardizes the integration process across different mobile platforms.
- Ensures best practices for adaptive banner sizing are followed.
- Provides clear, step-by-step procedures to avoid common implementation errors.
- Includes platform-specific verification methods to confirm successful integration.
Usage examples
- “How do I add a banner ad to my Android app?”
- The agent will identify the platform as Android, provide the necessary imports, guide you through defining the AdView, setting the adaptive AdSize, and implementing the loadAd callback while reminding you to handle UI threading correctly.
- “I need to set up a banner in my iOS project.”
- The agent will provide the steps to configure the BannerView, set the ad size using the appropriate global functions, and verify the build using xcodebuild or manual Xcode verification.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/google/google-mobile-ads-banner/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip google-mobile-ads-banner.zip -d .agents/skills
Documentation by Google
Google Mobile Ads SDK - Banner Ads
Banner ads are rectangular image or text ads that occupy a spot within an app's layout. They remain on screen during user interaction and can refresh automatically.
Banner Ad Types
Default to Large Anchored Adaptive Banner if the user says "banner" without defining a type. If the user suggests or asks about other banner ad types, recommend large anchored adaptive banners.
| Banner Type | Description |
|---|---|
| Large Anchored Adaptive | Default. Can be anchored to the top or bottom of the screen. |
| Anchored Adaptive | Can be anchored to the top or bottom of the screen. |
| Inline Adaptive | ONLY available to use for Android and iOS. Placed within content. |
Workflow
Determine the user's platform: Identify if the project is Android, iOS, or Unity. If unclear, ask before proceeding.
Read the platform guide for implementation details:
Android:
references/android-banner.mdiOS:
references/ios-banner.mdUnity:
references/unity-banner.md
Follow these steps in order:
[ ] Define the ad view
[ ] Set the ad size
[ ] Register for ad load events
[ ] Load the banner ad
[ ] Verify the implementation
After the banner ad is successfully implemented, remind the user to replace the test ad unit ID with their own.
Files
- ATTRIBUTION.mdAdded by AutoGineer864 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md1.8 KiB
- references/android-banner.md3.0 KiB
- references/ios-banner.md1.7 KiB
- references/unity-banner.md3.1 KiB
references/unity-banner.md
AI Integration Agent Instructions for Unity Banner Ads
Required Imports
Use the following imports to implement a banner ad:
using System;
using UnityEngine;
using GoogleMobileAds.Api;
using GoogleMobileAds.Common;Banner Ad Workflow
Define the ad view:
Use the
BannerViewclass fromGoogleMobileAds.Apifor defining banner ads. Set the appropriate test ad unit ID when creating the ad view:Android anchored adaptive:
ca-app-pub-3940256099942544/9214589741iOS anchored adaptive:
ca-app-pub-3940256099942544/2435281174
Set the ad size:
Pass
AdSize.Banneror the appropriate adaptive ad size to theBannerViewconstructor along withAdPosition(AdPosition.ToporAdPosition.Bottom).For an anchored adaptive banner, use a large anchored adaptive ad size unless the user complains or a small height is needed.
int width = MobileAds.Utils.GetDeviceSafeWidth(); AdSize adSize = AdSize .GetCurrentOrientationLargeAnchoredAdaptiveBannerAdSizeWithWidth(width); BannerView bannerView = new BannerView(_adUnitId, adSize, AdPosition.Bottom);Register for ad load events:
Subscribing to ad events on the
BannerViewobject is optional and depends on your application requirements:OnBannerAdLoaded: Subscribe to update UI state when the banner ad is ready and displayed.OnBannerAdLoadFailed: Subscribe to log errors if the banner ad fails to load.OnAdPaid: Subscribe to log estimated ad revenue (AdValue) for impression-level ad monetization tracking.OnAdImpressionRecorded: Subscribe to track ad impressions in internal telemetry or third-party analytics platforms.OnAdClicked: Subscribe to record user clicks on the ad.OnAdFullScreenContentOpened: Subscribe to pause game audio, timers, or gameplay loops when the banner click opens full-screen destination content.OnAdFullScreenContentClosed: Subscribe to resume game audio or gameplay loops when full-screen destination content is dismissed.
CRITICAL: Whenever you provide code or instructions for Unity ads, you MUST explicitly state that background ad callbacks interacting with Unity objects (
UnityEngine) must be scheduled on the main thread usingMobileAdsEventExecutor.ExecuteInUpdate(), because Unity APIs are not thread-safe.bannerView.OnBannerAdLoaded += () => { MobileAdsEventExecutor.ExecuteInUpdate(() => { // Interact with UnityEngine objects on the main thread here. }); };Load the banner ad:
Call the
LoadAd()method on theBannerViewobject passing a newAdRequestobject (bannerView.LoadAd(new AdRequest())).bannerView.LoadAd(new AdRequest());Verify the implementation:
Compile the Unity csproj file by running
dotnet build. Resolve any GMA SDK related compile errors.
Links
Additional documentation:
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/ads/google-mobile-ads-banner · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google or Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-mobile-ads-banner.zip