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

必要條件
導入作業
請確認橫幅檢視畫面已定義您希望使用者在一般 (收合) 橫幅廣告狀態下看到的大小。在廣告要求中加入額外參數,並將 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);
}
廣告重新整理行為
如果應用程式在 Ad Manager 網頁介面中為橫幅廣告設定自動重新整理功能,當系統為橫幅廣告版位要求可收合橫幅廣告時,後續重新整理廣告時就不會再要求可收合橫幅廣告。這是因為每次重新整理時顯示可收合橫幅廣告,可能會對使用者體驗造成負面影響。
如果您想在工作階段中的一段時間後,再載入其他可收合橫幅廣告,請在請求中包含可收合橫幅廣告參數,並手動載入廣告。
檢查已載入的廣告是否可摺疊
非可收合橫幅廣告可針對可收合橫幅廣告要求傳回,以便盡可能提高成效。呼叫 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-06-11 (世界標準時間)。
[[["容易理解","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-06-11 (世界標準時間)。"],[[["Collapsible banner ads, initially larger overlays, collapse to the requested banner size, enhancing smaller anchored ad performance."],["To implement, define your banner view's collapsed size and include an extra parameter in the ad request, specifying placement (`top` or `bottom`)."],["While auto-refresh is configured, subsequent refreshes won't request collapsible banners to maintain user experience; manual loading is needed."],["Use `isCollapsible` to verify if the loaded banner is indeed collapsible, helpful when requests fail."],["During the beta period, collapsible banners are exclusive to Google demand, with mediated ads appearing as standard banners."]]],["Collapsible banner ads display as a large overlay initially, then collapse to the standard banner size. To enable this, include an \"extras\" parameter with \"collapsible\" as the key and the placement (\"top\" or \"bottom\") as the value in the ad request. Refreshed ads in automated cases will not be collapsible. To load a new collapsible banner, make a manual request with the \"collapsible\" parameter. To confirm if a loaded banner is collapsible, check using `isCollapsible`. Collapsible ads are only supported for Google demand.\n"]]