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.