可收合橫幅廣告
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
可收合橫幅廣告一開始會以較大的重疊廣告顯示,並提供按鈕,可將廣告收合為原始要求的橫幅廣告大小。可收合橫幅廣告的目的是提升錨定廣告的成效,否則錨定廣告的尺寸會較小。本指南說明如何為現有橫幅刊登位置啟用可收合式橫幅廣告。

必要條件
導入作業
請確認橫幅檢視畫面已定義使用者在一般 (收合) 橫幅狀態中看到的尺寸。在廣告請求中加入 extras 參數,並將 collapsible
設為鍵,廣告刊登位置設為值。
可收合刊登位置會定義展開區域如何錨定至橫幅廣告。
Placement 值
|
行為 |
預定用途 |
top |
展開廣告的頂端會與收合廣告的頂端對齊。 |
廣告位於畫面頂端。 |
bottom |
展開廣告的底部會對齊收合廣告的底部。 |
廣告會顯示在畫面底部。 |
如果載入的廣告是可收合式橫幅,橫幅就會在置於檢視區塊階層後,立即顯示可收合的疊加層。
private void LoadBannerAd()
{
var bannerView = new BannerView(_adUnitId, AdSize.Banner, AdPosition.Bottom);
var adRequest = new AdRequest();
// Create an extra parameter that aligns the bottom of
// the expanded ad to the bottom of the bannerView.
adRequest.Extras.Add("collapsible", "bottom");
bannerView.LoadAd(adRequest);
}
廣告重新整理行為
如果應用程式在 AdMob 網路介面中設定橫幅廣告自動重新整理,當橫幅廣告版位請求可收合橫幅廣告時,後續重新整理廣告時不會再請求這類廣告。這是因為在每次重新整理時顯示可收合橫幅廣告,可能會對使用者體驗造成負面影響。
如要在工作階段中的一段時間後,再載入其他可收合橫幅廣告,請在請求中包含可收合橫幅廣告參數,並手動載入廣告。
檢查載入的廣告是否可收合
為盡可能提高成效,系統可能會在可收合橫幅廣告請求中,傳回不可收合的橫幅廣告。呼叫 isCollapsible
,檢查載入的最後一個橫幅是否可收合。如果要求無法載入,且先前的橫幅可收合,API 會傳回 true。
_bannerView.OnBannerAdLoaded += () =>
{
Debug.Log(_bannerView.IsCollapsible()
? "Banner is collapsible."
: "Banner is not collapsible.");
};
可收合橫幅廣告僅適用於 Google 需求。透過中介服務放送的廣告會正常顯示,不會是可收合的橫幅廣告。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-24 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-24 (世界標準時間)。"],[[["Collapsible banner ads start as larger overlays and can be collapsed to a standard banner size, improving the performance of smaller, anchored ads."],["To implement, define the collapsed banner size, and include an extra parameter in the ad request specifying the placement (top or bottom) for the expanded overlay."],["Auto-refresh is disabled for collapsible banner ads after the initial load to avoid impacting user experience; manually load them again with the collapsible parameter if needed."],["Verify if a loaded ad is collapsible using `isCollapsible` as non-collapsible ads might be served to ensure ad delivery."],["Currently, only Google demand supports collapsible banner ads during the beta period; mediated ads will display as regular banners."]]],["Collapsible banner ads expand from a smaller banner size to a larger overlay. To implement, define the desired collapsed banner size and include an \"extras\" parameter in the ad request with \"collapsible\" as the key and the ad's placement (\"top\" or \"bottom\") as the value. Expanded region anchors to the banner ad based on the specified placement. Subsequent ad refreshes won't be collapsible by default. Developers can check if the loaded ad is collapsible using `isCollapsible`. These ads are exclusive to Google demand.\n"]]