แบนเนอร์ที่ปรับเปลี่ยนได้ที่อยู่ด้านล่างสุด
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แบนเนอร์แบบปรับขนาดได้คือโฆษณาที่ปรับเปลี่ยนตามอุปกรณ์รุ่นใหม่ ซึ่งจะช่วยเพิ่ม
ประสิทธิภาพด้วยการปรับขนาดโฆษณาให้เหมาะกับแต่ละอุปกรณ์ แบนเนอร์แบบปรับขนาดได้พัฒนามาจากแบนเนอร์อัจฉริยะ
ที่รองรับเฉพาะความสูงแบบคงที่ โดยแบนเนอร์แบบใหม่นี้จะช่วยให้คุณสามารถระบุ
ความกว้างของโฆษณาเพื่อนำไปใช้กำหนดขนาดโฆษณาให้เหมาะสมได้
แบนเนอร์แบบปรับได้ใช้สัดส่วนภาพแบบคงที่แทนที่จะใช้ความสูงคงที่ในการเลือกขนาดโฆษณาที่ดีที่สุด ซึ่งส่งผลให้การยึดพื้นที่ส่วนใดส่วนหนึ่งในหน้าจอของโฆษณาแบนเนอร์ในอุปกรณ์ต่างๆ มีความสอดคล้องกันมากขึ้นและเปิดโอกาสให้มีการปรับปรุงประสิทธิภาพให้ดีขึ้นด้วย
เมื่อใช้แบนเนอร์แบบปรับขนาดได้ โปรดทราบว่าแบนเนอร์จะแสดงขนาดคงที่สำหรับอุปกรณ์และความกว้างหนึ่งๆ เสมอ เมื่อทดสอบเลย์เอาต์ใน
อุปกรณ์ที่กำหนดแล้ว คุณจะมั่นใจได้ว่าขนาดโฆษณาจะไม่เปลี่ยนแปลง อย่างไรก็ตาม ขนาดของครีเอทีฟโฆษณาแบนเนอร์อาจเปลี่ยนแปลงไปในอุปกรณ์ต่างๆ ดังนั้น
เราขอแนะนำให้ตรวจสอบว่าเลย์เอาต์ของคุณรองรับความสูงของโฆษณาที่แตกต่างกันได้
ในบางกรณีซึ่งเกิดขึ้นไม่บ่อยนัก ระบบอาจไม่แสดงโฆษณาขนาดที่ปรับเปลี่ยนได้เต็มรูปแบบ และจะแสดงครีเอทีฟโฆษณาขนาดมาตรฐานตรงกลางช่องนี้แทน
กรณีที่ควรใช้แบนเนอร์แบบปรับขนาดได้
แบนเนอร์แบบปรับขนาดได้ถูกออกแบบมาให้ใช้แทนที่แบนเนอร์ขนาด 320x50 ซึ่งเป็นมาตรฐานอุตสาหกรรมได้โดยตรง รวมถึงแบนเนอร์อัจฉริยะ ซึ่งเป็นรูปแบบที่แบนเนอร์นี้เข้ามาแทนที่
โดยทั่วไปแล้ว ขนาดแบนเนอร์เหล่านี้มักใช้เป็นแบนเนอร์ยึดตำแหน่ง ซึ่งมักจะ
ล็อกไว้ที่ด้านบนหรือด้านล่างของหน้าจอ สำหรับแบนเนอร์ที่ยึดไว้ดังกล่าว สัดส่วนภาพเมื่อใช้แบนเนอร์แบบปรับขนาดได้จะคล้ายกับโฆษณามาตรฐานขนาด 320x50 ดังที่เห็นในภาพหน้าจอเหล่านี้

แบนเนอร์ 320x50
|

แบนเนอร์อัจฉริยะ
|

แบนเนอร์แบบปรับขนาดได้
|
แบนเนอร์แบบปรับขนาดได้จะใช้ขนาดหน้าจอที่มีอยู่ได้ดีกว่า นอกจากนี้
เมื่อเทียบกับแบนเนอร์อัจฉริยะแล้ว แบนเนอร์แบบปรับขนาดได้เป็นตัวเลือกที่ดีกว่าเนื่องจาก
โดยจะใช้ความกว้างที่ระบุแทนความกว้างแบบเต็มหน้าจอ ซึ่งช่วยให้คุณ
คำนึงถึงพื้นที่ปลอดภัยได้
โดยจะเลือกความสูงที่เหมาะสมสำหรับอุปกรณ์นั้นๆ แทนที่จะใช้ความสูงคงที่ในอุปกรณ์ขนาดต่างๆ ซึ่งจะช่วยลดผลกระทบจากการกระจายตัวของอุปกรณ์
หมายเหตุการติดตั้งใช้งาน
เมื่อติดตั้งใช้งานแบนเนอร์แบบปรับขนาดได้ในแอป โปรดคำนึงถึงประเด็นต่อไปนี้
คุณต้องทราบความกว้างของมุมมองที่จะวางโฆษณา และควรพิจารณาความกว้างของอุปกรณ์และพื้นที่ปลอดภัยที่เกี่ยวข้อง
ตรวจสอบว่าพื้นหลังของมุมมองโฆษณาทึบแสงเพื่อให้เป็นไปตามนโยบายของ AdMob
เมื่อโฆษณาขนาดเล็กแสดงซึ่งไม่เต็มช่องโฆษณา
ตรวจสอบว่าคุณใช้ Google Mobile Ads C++ SDK เวอร์ชันล่าสุด สำหรับ
สื่อกลาง ให้ใช้อะแดปเตอร์สื่อกลางแต่ละรายการเวอร์ชันล่าสุด
ขนาดแบนเนอร์แบบปรับขนาดได้ได้รับการออกแบบมาให้ทำงานได้ดีที่สุดเมื่อใช้เต็มความกว้างที่มี
โดยในกรณีส่วนใหญ่จะเป็นความกว้างแบบเต็มหน้าจอของ
อุปกรณ์ที่ใช้ อย่าลืมพิจารณาพื้นที่ปลอดภัยที่เกี่ยวข้อง
SDK โฆษณาในอุปกรณ์เคลื่อนที่ของ Google C++ จะแสดงความสูงของโฆษณาที่เพิ่มประสิทธิภาพแล้วสำหรับความกว้างที่ระบุใน firebase::gma::AdSize
มี 3 วิธีในการรับขนาดโฆษณาสําหรับแบนเนอร์แบบปรับขนาดได้ ได้แก่ วิธีสําหรับแนวนอน แนวตั้ง และการวางแนวปัจจุบัน ณ เวลาที่เรียกใช้
ขนาดที่แสดงสำหรับความกว้างหนึ่งๆ ในอุปกรณ์หนึ่งๆ จะเหมือนกันเสมอ
ดังนั้นเมื่อทดสอบเลย์เอาต์ในอุปกรณ์หนึ่งๆ แล้ว คุณจึงมั่นใจได้ว่า
ขนาดโฆษณาจะไม่เปลี่ยนแปลง
ความสูงของแบนเนอร์ที่ตรึงไว้จะไม่เกิน 15% ของความสูงของอุปกรณ์ และ
จะไม่ต่ำกว่า 50 จุด
การเริ่มใช้งานอย่างง่าย
ทำตามขั้นตอนด้านล่างเพื่อใช้แบนเนอร์สมอแบบปรับได้ที่เรียบง่าย
รับขนาดโฆษณาแบนเนอร์แบบปรับขนาดได้ ระบบจะใช้ขนาดที่คุณได้รับเพื่อขอ
แบนเนอร์แบบปรับขนาดได้ หากต้องการรับขนาดโฆษณาที่ปรับเปลี่ยนได้ ให้ตรวจสอบว่าคุณได้ทำสิ่งต่อไปนี้
รับความกว้างของอุปกรณ์ที่ใช้ หรือตั้งค่าความกว้างของคุณเองหากไม่ต้องการใช้ความกว้างเต็มหน้าจอ
ใช้วิธีการแบบคงที่ที่เหมาะสมในคลาส AdSize
เช่น
GetCurrentOrientationAnchoredAdaptiveBannerAdSize(uint32_t width)
เพื่อ
รับออบเจ็กต์ AdSize
แบบปรับได้สำหรับการวางแนวที่เลือก
เรียกใช้ Initialize()
ใน AdView
ด้วย AdSize
แบบปรับอัตโนมัติที่คุณสร้างขึ้น
ดูตัวอย่างฉบับเต็มได้ที่ด้านล่าง
สร้างออบเจ็กต์ AdRequest
แล้วโหลดแบนเนอร์โดยใช้เมธอด loadAd()
ในมุมมองโฆษณาที่เตรียมไว้ เช่นเดียวกับที่คุณใช้กับคำขอแบนเนอร์ปกติ
โค้ดตัวอย่าง
ต่อไปนี้คือตัวอย่าง AdView
ที่จะโหลดแบนเนอร์แบบปรับขนาดได้
// Determine view width in pixels based on your app's current width on the
// device's screen. This process will vary depending on which windowing toolkit
// you're using.
firebase::gma::AdSize adaptive_ad_size =
AdSize::GetCurrentOrientationAnchoredAdaptiveBannerAdSize(view_width);
// my_ad_parent is a reference to an iOS UIView or an Android Activity.
// This is the parent UIView or Activity of the banner view.
firebase::gma::AdParent ad_parent =
static_cast<firebase::gma::AdParent>(my_ad_parent);
firebase::Future<void> result =
ad_view->Initialize(ad_parent, kBannerAdUnit, adaptive_ad_size);
ในที่นี้ ฟังก์ชัน
GetCurrentOrientationAnchoredAdaptiveBannerAdSize(uint32_t width)
ใช้เพื่อ
รับขนาดของแบนเนอร์ในตำแหน่งที่ยึดไว้สำหรับ
การวางแนวของอินเทอร์เฟซปัจจุบัน หากต้องการโหลดแบนเนอร์ที่ยึดไว้ล่วงหน้าในแนวนอนหรือแนวตั้งที่กำหนด ให้ใช้ฟังก์ชันที่เกี่ยวข้องจาก GetPortraitAnchoredAdaptiveBannerAdSize(uint32_t width)
และ GetLandscapeAnchoredAdaptiveBannerAdSize(uint32_t width)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eAdaptive banners optimize ad size for each device, improving performance by using fixed aspect ratios for a consistent screen presence.\u003c/p\u003e\n"],["\u003cp\u003eThey are drop-in replacements for standard 320x50 banners and smart banners, best used as anchored banners (top or bottom of the screen).\u003c/p\u003e\n"],["\u003cp\u003eAdaptive banners offer advantages over smart banners by utilizing provided width for safe areas and adjusting height for optimal display on various devices.\u003c/p\u003e\n"],["\u003cp\u003eImplementation requires knowing the ad view's width (considering device width and safe areas), using an opaque background, and the latest Google Mobile Ads C++ SDK.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can obtain the adaptive banner size using \u003ccode\u003eAdSize\u003c/code\u003e class methods, considering device width and orientation, to initialize and load the ad view.\u003c/p\u003e\n"]]],["Adaptive banners optimize ad size per device using fixed aspect ratios instead of fixed heights, improving performance and screen usage compared to smart banners. Key actions include determining the ad view width, accounting for safe areas, and using `AdSize` methods (e.g., `GetCurrentOrientationAnchoredAdaptiveBannerAdSize`) to get the optimal ad size for a specific orientation. Developers should ensure opaque ad view backgrounds and use the latest SDK. The returned ad size remains consistent on a given device but may differ across devices.\n"],null,["# Anchored adaptive banners\n\nAdaptive banners are the next generation of responsive ads, maximizing\nperformance by optimizing ad size for each device. Improving on smart banners,\nwhich only supported fixed heights, adaptive banners let you specify the\nad-width and use this to determine the optimal ad size.\n\nTo pick the best ad size, adaptive banners use fixed aspect ratios instead of\nfixed heights. This results in banner ads that occupy a more consistent portion\nof the screen across devices and provide opportunities for improved performance.\n\nWhen working with adaptive banners, note that they will always return a\nconstant size for a given device and width. Once you've tested your layout on a\ngiven device, you can be sure that the ad size will not change. However, the\nsize of the banner creative may change across different devices. Consequently,\nit is recommended to ensure your layout can accommodate variances in ad height.\nIn rare cases, the full adaptive size may not be filled and a standard size\ncreative will be centered in this slot instead.\n\nWhen to use adaptive banners\n----------------------------\n\nAdaptive banners are designed to be a drop-in replacement for the industry\nstandard 320x50 banner size, as well as the smart banner format they supersede.\n\nThese banner sizes are commonly used as anchored banners, which are usually\nlocked to the top or bottom of the screen. For such anchored banners, the aspect\nratio when using adaptive banners will be similar to that of a standard 320x50\nad, as can be seen in these screenshots:\n\n|---------------|--------------|-----------------|\n| 320x50 banner | Smart banner | Adaptive banner |\n\nAn adaptive banner makes better use of the available screen size. Additionally,\ncompared to a smart banner, an adaptive banner is a better choice because:\n\n- It uses a provided width rather than full screen width, enabling you to\n account for safe areas.\n\n- It selects an optimal height for the specific device, rather than having a\n constant height across different sized devices, mitigating the effects of\n device fragmentation.\n\nImplementation notes\n--------------------\n\nWhen implementing adaptive banners in your app, keep the following points in\nmind:\n\n- You must know the width of the view that the ad will be placed in, *and this\n should take into account the device width and any safe areas that are\n applicable*.\n\n- Ensure that your ad view background is opaque to be compliant with AdMob\n policies when smaller ad sizes serve that do not fill the ad slot.\n\n- Ensure you are using the latest version of the Google Mobile Ads C++ SDK. For\n mediation, use the latest version of each mediation adapter.\n\n- The adaptive banner sizes are designed to work best when using the full\n available width. In most cases, this will be the full width of the screen of\n the device in use. Be sure to take into account applicable safe areas.\n\n- The Google Mobile Ads C++ SDK returns an optimized ad height for the given\n width in a `firebase::gma::AdSize`.\n\n- There are three methods to get an ad size for adaptive banners---one for\n landscape, one for portrait, and one for the current orientation at the time\n of execution.\n\n- The size returned for a given width on a given device will always be the same,\n hence once you've tested your layout on a given device, you can be sure that\n the ad size will not change.\n\n- Anchored banner height is never larger than 15% of the device's height and\n never smaller than 50 points.\n\nQuick start\n-----------\n\nFollow the steps below to implement a simple adaptive anchor banner.\n\n1. Get an adaptive banner ad size. The size you get will be used to request\n your adaptive banner. To get the adaptive ad size, make sure that you:\n\n 1. Get the width of the device in use, or set your own width if you don't\n want to use the full width of the screen.\n\n 2. Use the appropriate static methods on the `AdSize` class, such as\n `GetCurrentOrientationAnchoredAdaptiveBannerAdSize(uint32_t width)` to\n get an adaptive `AdSize` object for the chosen orientation.\n\n 3. Invoke `Initialize()` on the `AdView` with the adaptive `AdSize` you've\n created.\n\n A full example is included below.\n2. Create an `AdRequest` object and load your banner using the `loadAd()`\n method on your prepared ad view, just like you would with a normal banner\n request.\n\nSample code\n-----------\n\nHere's an example of an `AdView` that will load an adaptive banner: \n\n // Determine view width in pixels based on your app's current width on the\n // device's screen. This process will vary depending on which windowing toolkit\n // you're using.\n\n firebase::gma::AdSize adaptive_ad_size =\n AdSize::GetCurrentOrientationAnchoredAdaptiveBannerAdSize(view_width);\n\n // my_ad_parent is a reference to an iOS UIView or an Android Activity.\n // This is the parent UIView or Activity of the banner view.\n firebase::gma::AdParent ad_parent =\n static_cast\u003cfirebase::gma::AdParent\u003e(my_ad_parent);\n firebase::Future\u003cvoid\u003e result =\n ad_view-\u003eInitialize(ad_parent, kBannerAdUnit, adaptive_ad_size);\n\nHere, the function\n`GetCurrentOrientationAnchoredAdaptiveBannerAdSize(uint32_t width)` is used to\nget the size for a banner in an anchored position for the current interface\norientation. For pre-loading an anchored banner in a given orientation, use the\nrelevant function from `GetPortraitAnchoredAdaptiveBannerAdSize(uint32_t width)`\nand `GetLandscapeAnchoredAdaptiveBannerAdSize(uint32_t width)`."]]