google-mobile-ads-banner
Provides instructions to implement, integrate, or configure Google Mobile Ads (GMA) banner ads in Android, iOS, or Unity mobile applications. Use when the task involves setting up banner ads in a mobile application. Don't use for other ad formats like interstitial or rewarded ads.
摘要
- 用途
- 说明如何透过 Google Mobile Ads SDK 在应用程序版面中放置持续显示且可自动刷新的矩形广告。
- 使用时机
- 在为 Android、iOS 或 Unity 项目选择或实作横幅广告格式时使用;先确认平台,若未指定格式则预设采用大型锚定自适应横幅。
- 输出结果
- 提供依平台而异的实作指引,包括定义广告查看区并设置大小、注册加载事件、加载并验证横幅广告,以及提醒用户以自己的广告单元 ID 取代测试 ID。
上游变更(5 条,最新收录 2026-09-22)
703f8d2 Move ads skills from per-product subdirectories to top-level skills/ads/ directory. 将内容未变更的技能文件从 `skills/ads/google-mobile-ads/google-mobile-ads-banner/SKILL.md` 移至 `skills/ads/google-mobile-ads-banner/SKILL.md`。 c75b500 Restructure the YAML frontmatter in all SKILL.md files to nest the 'category' field under the 'metadata:' block. The 'category' field is used to organize the skills in the README.md 在技能的 YAML `metadata` 区块中添加 `category: GoogleAds`。 b13a5a1 Add new skills for Google Advertising and Measurement. 添加横幅广告技能,提供广告放置指引、Android/iOS 实作工作流程,并提醒替换测试广告单元 ID。 npx skills add "lettucebo/Skills#v2.2.0@google-mobile-ads-banner" --full-depth ⚠ v2.2.0 发布后即可使用
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.md - iOS:
references/ios-banner.md - Unity:
references/unity-banner.md
- Android:
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.