적응형 앵커 배너
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
적응형 배너는 광고 크기를 기기별로 최적화하여 실적을
극대화하는 차세대 반응형 광고입니다. 고정된 높이만 지원하는 스마트 배너를 개선한 적응형 배너를 사용하면 사용자가 광고 너비를 지정함으로써 최적의 광고 크기를 결정할 수 있습니다.
최적의 광고 크기를 선택하기 위해 적응형 배너는 고정된 높이 대신 고정된 가로세로 비율을 사용합니다. 따라서 기기에서 더 일관된 화면 비율을 차지하는 배너 광고가 게재되므로 실적을 높일 수 있는 가능성이 커집니다.
적응형 배너로 작업할 때는 지정된 기기 및 너비에 대해 항상 일정한 크기가 반환됩니다. 특정 기기에서 레이아웃을 테스트한 후에는 광고 크기가 변경되지 않습니다. 그러나 배너 소재의 크기는 기기에 따라 달라질 수 있습니다. 따라서 레이아웃에서 광고 높이 변화를 수용하도록 설정하는 것이 좋습니다. 드문 경우이지만 적응형 광고의 전체 크기가 표시되지 않을 수 있으며, 이때 표준 크기의 광고 소재가 이 슬롯의 중앙에 대신 배치됩니다.
기본 요건
적응형 배너를 사용하는 것이 효과적인 경우
적응형 배너는 업계 표준 320x50 배너 크기 및 스마트 배너 형식을 대체할 수 있도록 설계되었습니다.
이러한 배너 크기는 일반적으로 화면 상단이나 하단에 고정되는 앵커 광고 배너로 흔히 사용됩니다.
앵커 광고 배너의 경우 적응형 배너를 사용할 때의 가로세로 비율은 표준 320x50 광고의 비율과 비슷합니다(아래 3가지 예 참고).
적응형 배너는 사용 가능한 화면 크기를 더 효과적으로 사용합니다. 또한 스마트 배너와 비교하자면 다음과 같은 이유 때문에 적응형 배너를 사용하는 것이 더 좋습니다.
구현 참고사항
앱에서 적응형 배너를 구현하는 경우 다음 사항에 유의하세요.
- 광고가 게재될 보기의 너비를 알아야 하며 해당하는 기기 너비와 적용 가능한 안전 영역 또는 컷아웃을 고려해야 합니다.
- 광고 슬롯을 채울 수 없는 작은 크기의 광고가 게재되는 경우
AdMob 정책을 준수하도록
광고 뷰 배경이 불투명한지 확인합니다.
- 최신 버전의 Google 모바일 광고 Unity 플러그인을 사용 중인지 확인합니다. 미디에이션의 경우 각 미디에이션 어댑터의 최신 버전을 사용합니다.
- 적응형 배너 크기는 전체 너비를 사용할 때 가장 효과적으로 작동하도록 설계되었습니다. 대부분의 경우 이 값은 사용 중인 기기 화면의 전체 너비입니다. 적용 가능한 안전 영역을 고려해야 합니다.
- Google 모바일 광고 SDK는 적응형 AdSize API 사용 시 지정된 너비에 맞게 광고 높이를 최적화하여 배너 크기를 조정합니다.
- 적응형 배너의 광고 크기를 가져오는 세 가지 메서드가 있습니다. 가로 모드에서는
AdSize.GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth
, 세로 모드에서는 AdSize.GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth
, 실행 시점의 기기 방향에서는 AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth
메서드를 사용합니다.
- 특정 기기에서 특정 너비에 대해 반환되는 크기는 항상 동일하므로 특정 기기에서 레이아웃을 테스트한 후에는 광고 크기가 변경되지 않습니다.
- 앵커 광고 배너 높이는 기기 높이의 15% 또는 90dp(밀도 독립형 픽셀)를 초과할 수 없으며, 50dp보다는 커야 합니다.
- 전체 너비 배너의 경우 특정 너비를 제공하는 대신
AdSize.FullWidth
플래그를 사용할 수 있습니다.
빠른 시작
간단한 적응형 앵커 배너를 구현하려면 아래 단계를 따르세요.
- 적응형 배너 광고 크기를 가져옵니다. 가져오는 크기는 적응형 배너를 요청하는 데 사용됩니다. 적응형 광고 크기를 가져오려면 다음 항목을 확인하세요.
- 화면의 전체 너비를 사용하지 않으려는 경우에는 밀도 독립 픽셀로 사용 중인 기기의 너비를 가져오거나 원하는 너비를 설정하세요.
Screen.width
같은 Unity API는 픽셀의 절댓값을 반환하므로 MobileAds.Utils.GetDeviceScale()
에서 검색 가능한 기기 배율로 나눌 수 있어야 합니다.
- 전체 너비 배너에는
AdSize.FullWidth
플래그를 사용합니다.
AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width)
같은 광고 크기 클래스에 적절한 정적 메서드를 사용하여 기기의 현재 방향에 대한 적응형 AdSize
객체를 가져옵니다.
- 광고 단위 ID, 적응형 크기, 관련성 높은 광고 게재 위치를 사용하여
BannerView
객체를 만듭니다.
- 일반적인 배너를 요청하는 것과 마찬가지로 준비된 광고 보기에서 광고 요청 객체를 만들고
LoadAd()
메서드를 사용하여 배너를 로드합니다.
코드 예
다음은 안전 영역을 고려하여 화면 너비에 맞게 적응형 배너를 로드하고 새로고침하는 스크립트의 예입니다.
using UnityEngine;
using System;
using GoogleMobileAds.Api;
public class AdaptiveBannerSample : MonoBehaviour
{
private BannerView _bannerView;
// Use this for initialization
void Start()
{
// Set your test devices.
// https://developers.google.com/ad-manager/mobile-ads-sdk/unity/test-ads
RequestConfiguration requestConfiguration = new RequestConfiguration
{
TestDeviceIds = new List<string>
{
AdRequest.TestDeviceSimulator,
// Add your test device IDs (replace with your own device IDs).
#if UNITY_IPHONE
"96e23e80653bb28980d3f40beb58915c"
#elif UNITY_ANDROID
"75EF8D155528C04DACBBA6F36F433035"
#endif
}
};
MobileAds.SetRequestConfiguration(requestConfiguration);
// Initialize the Google Mobile Ads SDK.
MobileAds.Initialize((InitializationStatus status) =>
{
RequestBanner();
});
}
public void OnGUI()
{
GUI.skin.label.fontSize = 60;
Rect textOutputRect = new Rect(
0.15f * Screen.width,
0.25f * Screen.height,
0.7f * Screen.width,
0.3f * Screen.height);
GUI.Label(textOutputRect, "Adaptive Banner Example");
}
private void RequestBanner()
{
// These ad units are configured to always serve test ads.
#if UNITY_EDITOR
string adUnitId = "unused";
#elif UNITY_ANDROID
string adUnitId = "ca-app-pub-3212738706492790/6113697308";
#elif UNITY_IPHONE
string adUnitId = "ca-app-pub-3212738706492790/5381898163";
#else
string adUnitId = "unexpected_platform";
#endif
// Clean up banner ad before creating a new one.
if (_bannerView != null)
{
_bannerView.Destroy();
}
AdSize adaptiveSize =
AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(AdSize.FullWidth);
_bannerView = new BannerView(adUnitId, adaptiveSize, AdPosition.Bottom);
// Register for ad events.
_bannerView.OnBannerAdLoaded += OnBannerAdLoaded;
_bannerView.OnBannerAdLoadFailed += OnBannerAdLoadFailed;
AdRequest adRequest = new AdRequest();
// Load a banner ad.
_bannerView.LoadAd(adRequest);
}
#region Banner callback handlers
private void OnBannerAdLoaded(object sender, EventArgs args)
{
Debug.Log("Banner view loaded an ad with response : "
+ _bannerView.GetResponseInfo());
Debug.Log("Ad Height: {0}, width: {1}",
_bannerView.GetHeightInPixels(),
_bannerView.GetWidthInPixels());
}
private void OnBannerAdLoadFailed(LoadAdError error)
{
Debug.LogError("Banner view failed to load an ad with error : "
+ error);
}
#endregion
}
여기서 AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth
함수는 현재 인터페이스 방향에 대한 앵커 광고 위치의 배너 크기를 가져오는 데 사용됩니다. 앵커 광고 배너를 지정된 방향으로 미리 로드하려면 AdSize.GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth
및 AdSize.GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth
의 관련 함수를 사용하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eAdaptive banners maximize ad performance by optimizing the ad size for each device, using fixed aspect ratios for the best ad size.\u003c/p\u003e\n"],["\u003cp\u003eThey are a drop-in replacement for standard 320x50 banners and smart banners, designed for anchored positions (top or bottom of the screen).\u003c/p\u003e\n"],["\u003cp\u003eAdaptive banners offer advantages over smart banners: using any provided width (accounting for safe areas), selecting optimal height per device (reducing fragmentation).\u003c/p\u003e\n"],["\u003cp\u003eWhen implementing, consider the view's width (including safe areas), use an opaque background, and use the latest SDK and adapter versions.\u003c/p\u003e\n"],["\u003cp\u003eTo get an adaptive banner size, use the provided static methods, such as \u003ccode\u003eAdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width)\u003c/code\u003e, after calculating the device or desired width.\u003c/p\u003e\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 supported only fixed heights, adaptive banners let you specify the\nad width and use this to determine the optimal ad size.\n\nTo choose 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 provides opportunities for improved\nperformance.\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,\nwe recommend that your layout accommodate variances in ad height. In rare cases,\nthe full adaptive size may not be filled and a standard size creative will be\ncentered in this slot instead.\n\nPrerequisites\n-------------\n\n- [Import the Mobile Ads Unity plugin](/ad-manager/mobile-ads-sdk/unity/quick-start#import_the_mobile_ads_unity_plugin)\n\n- [Include the Mobile Ads SDK](/ad-manager/mobile-ads-sdk/unity/quick-start#include_the_mobile_ads_sdk)\n\nWhen to use adaptive banners\n----------------------------\n\nAdaptive banners are designed to be a drop-in replacement for both the industry\nstandard 320x50 banner size and the smart banner format which they supersede.\n\nThese banner sizes are commonly used as anchored banners, which are usually\nlocked to the top or bottom of the screen.\n\nFor such anchored banners, the aspect ratio when using adaptive banners will be\nsimilar to that of a standard 320x50 ad, as can be seen in the three examples\nbelow:\n\n|---------------|-----------------|--------------|\n| 320x50 banner | Adaptive banner | Smart banner |\n\nThe 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 any width you provide, rather than forcing the width to be full\n screen, enabling you to account for the safe area on iOS, and display cutouts\n on Android.\n\n- It selects an optimal height for the specific device, rather than having a\n constant height across different size 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 mind:\n\n- You must know the width of the view that the ad will be placed in, **and this should take into account the device width and any safe areas or\n cutouts that are applicable**.\n- Ensure that your ad view background is opaque to be compliant with AdMob policies when smaller ad sizes serve that do not fill the ad slot.\n- Ensure you are using the latest version of the Google Mobile Ads Unity plugin. For mediation, use the latest version of each mediation adapter.\n- The adaptive banner sizes are designed to work best when using the full available width. In most cases, this will be the full width of the screen of the device in use. Be sure to take into account applicable safe areas.\n- The Google Mobile Ads SDK will size the banner with an optimized ad height for the given width when using the adaptive AdSize APIs.\n- There are three methods to get an ad size for adaptive: `AdSize.GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth` for landscape, `AdSize.GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth` for portrait, and `AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth` for the current orientation at the time of execution.\n- The size returned for a given width on a given device will always be the same, hence once you've tested your layout on a given device, you can be sure that the ad size will not change.\n- Anchored banner height is never larger than the lesser of 15% of the device's height or 90 density independent pixels and never smaller than 50 density independent pixels.\n- For full width banners, you can use the `AdSize.FullWidth` flag instead of supplying a specific width.\n\nQuickstart\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 your adaptive banner. To get the adaptive ad size, make sure that you:\n 1. Get the width of the device in use in density independent pixels, or set your own width if you don't want to use the full width of the screen. Since Unity APIs such as `Screen.width` return absolute pixels, you need to divide by device scale (retrievable from `MobileAds.Utils.GetDeviceScale()`).\n 2. Use the `AdSize.FullWidth` flag for full width banners.\n 3. Use the appropriate static methods on the ad size class, such as `AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width)` to get an adaptive `AdSize` object for the current orientation.\n2. Create a `BannerView` object with your ad unit ID, the adaptive size, and the relevant position for your ad.\n3. Create an ad request object and load your banner using the `LoadAd()` method on your prepared ad view, just like you would with a normal banner request.\n\nCode example\n------------\n\nHere's an example script that loads and reloads an adaptive banner to fit the\nwidth of the screen, taking into account safe area: \n\n using UnityEngine;\n using System;\n using GoogleMobileAds.Api;\n\n public class AdaptiveBannerSample : MonoBehaviour\n {\n private BannerView _bannerView;\n\n // Use this for initialization\n void Start()\n {\n // Set your test devices.\n // https://developers.google.com/ad-manager/mobile-ads-sdk/unity/test-ads\n RequestConfiguration requestConfiguration = new RequestConfiguration\n {\n TestDeviceIds = new List\u003cstring\u003e\n {\n AdRequest.TestDeviceSimulator,\n // Add your test device IDs (replace with your own device IDs).\n #if UNITY_IPHONE\n \"96e23e80653bb28980d3f40beb58915c\"\n #elif UNITY_ANDROID\n \"75EF8D155528C04DACBBA6F36F433035\"\n #endif\n }\n };\n MobileAds.SetRequestConfiguration(requestConfiguration);\n\n // Initialize the Google Mobile Ads SDK.\n MobileAds.Initialize((InitializationStatus status) =\u003e\n {\n RequestBanner();\n });\n }\n\n public void OnGUI()\n {\n GUI.skin.label.fontSize = 60;\n Rect textOutputRect = new Rect(\n 0.15f * Screen.width,\n 0.25f * Screen.height,\n 0.7f * Screen.width,\n 0.3f * Screen.height);\n GUI.Label(textOutputRect, \"Adaptive Banner Example\");\n }\n\n private void RequestBanner()\n {\n // These ad units are configured to always serve test ads.\n #if UNITY_EDITOR\n string adUnitId = \"unused\";\n #elif UNITY_ANDROID\n string adUnitId = \"ca-app-pub-3212738706492790/6113697308\";\n #elif UNITY_IPHONE\n string adUnitId = \"ca-app-pub-3212738706492790/5381898163\";\n #else\n string adUnitId = \"unexpected_platform\";\n #endif\n\n // Clean up banner ad before creating a new one.\n if (_bannerView != null)\n {\n _bannerView.Destroy();\n }\n\n AdSize adaptiveSize =\n AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(AdSize.FullWidth);\n\n _bannerView = new BannerView(adUnitId, adaptiveSize, AdPosition.Bottom);\n\n // Register for ad events.\n _bannerView.OnBannerAdLoaded += OnBannerAdLoaded;\n _bannerView.OnBannerAdLoadFailed += OnBannerAdLoadFailed;\n\n AdRequest adRequest = new AdRequest();\n\n // Load a banner ad.\n _bannerView.LoadAd(adRequest);\n }\n\n #region Banner callback handlers\n\n private void OnBannerAdLoaded(object sender, EventArgs args)\n {\n Debug.Log(\"Banner view loaded an ad with response : \"\n + _bannerView.GetResponseInfo());\n Debug.Log(\"Ad Height: {0}, width: {1}\",\n _bannerView.GetHeightInPixels(),\n _bannerView.GetWidthInPixels());\n }\n\n private void OnBannerAdLoadFailed(LoadAdError error)\n {\n Debug.LogError(\"Banner view failed to load an ad with error : \"\n + error);\n }\n\n #endregion\n }\n\nHere the function\n`AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth` is used\nto get 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 `AdSize.GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth`\nand `AdSize.GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth`."]]