可收合橫幅廣告
可收合橫幅廣告是橫幅廣告,一開始會以較大的重疊廣告顯示,並提供按鈕,可將廣告收合為原先要求的橫幅廣告大小。可收合橫幅廣告旨在提升錨定廣告的成效,因為錨定廣告的尺寸較小。本指南說明如何為現有的橫幅刊登位置啟用可摺疊的橫幅廣告。

必要條件
實作
請確認橫幅廣告的顯示方式,符合您希望使用者在一般 (收合) 橫幅廣告狀態下看到的大小。在廣告要求中加入額外參數,並將 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-02-20 (世界標準時間)。
[null,null,["上次更新時間:2025-02-20 (世界標準時間)。"],[[["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"]]