Stay organized with collections
Save and categorize content based on your preferences.
GoogleMobileAds.Api.AdManager.AdManagerBannerView
Banner view that works with Google Ad Manager.
Summary
Banner views occupy a spot within an app's layout. They stay on screen while users are interacting with the app.
Inheritance
Inherits from:
GoogleMobileAds.Api.BannerView
Properties
|
ValidAdSizes
|
Sets the supported sizes of the banner ad.
|
Events
OnAppEventReceived
Action< AppEvent > OnAppEventReceived
Raised when the app receives an event from the banner ad.
Properties
ValidAdSizes
List< AdSize > ValidAdSizes
Sets the supported sizes of the banner ad.
In most cases, only one ad size will be specified. Use one of the predefined standard ad sizes (such as AdSize.MediumRectangle), or create one by specifying width and height.
Multiple ad sizes can be specified if your application can appropriately handle multiple ad sizes. For example, your application might read ValidAdSizes during the AdManagerBannerView::OnBannerAdLoaded callback and change the layout according to the size of the ad that was loaded. If multiple ad sizes are specified, the AdManagerBannerView will assume the size of the first ad size until an ad is loaded.
This method also immediately resizes the currently displayed ad, so calling this method after an ad has been loaded is not recommended unless you know for certain that the content of the ad will render correctly in the new ad size. This can be used if an ad needs to be resized after it has been loaded. If more than one ad size is specified, the currently displayed ad will be resized to the first ad size.
Public functions
AdManagerBannerView
AdManagerBannerView(
string adUnitId,
AdSize adSize,
AdPosition position
)
Creates an Ad Manager banner view with a standard position.
AdManagerBannerView
AdManagerBannerView(
string adUnitId,
AdSize adSize,
int x,
int y
)
Creates an Ad Manager banner view with a custom position.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eAdManagerBannerView\u003c/code\u003e is a UI element that displays banner ads from Google Ad Manager within your app.\u003c/p\u003e\n"],["\u003cp\u003eThese banner ads persist on screen while users interact with the app, occupying a designated space in the layout.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the banner's position and size, and even support multiple ad sizes for flexibility.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAdManagerBannerView\u003c/code\u003e provides events like \u003ccode\u003eOnAppEventReceived\u003c/code\u003e and properties like \u003ccode\u003eValidAdSizes\u003c/code\u003e to handle ad interactions and configurations.\u003c/p\u003e\n"],["\u003cp\u003eTwo constructors are available for creating banner views: one for standard ad positions and another for custom positions defined by x and y coordinates.\u003c/p\u003e\n"]]],["The `AdManagerBannerView` displays banner ads within an app's layout. It offers two constructors: one for standard positioning using `AdPosition` and another for custom positioning via `x` and `y` coordinates. It supports setting multiple banner `AdSize` options via `ValidAdSizes`. The `OnAppEventReceived` event is triggered when a banner ad sends an event. `AdManagerBannerView` allows you to use predefined sizes or creating new ones and resizes the ad as needed.\n"],null,["# GoogleMobileAds.Api.AdManager.AdManagerBannerView Class Reference\n\nGoogleMobileAds.Api.AdManager.AdManagerBannerView\n=================================================\n\nBanner view that works with Google Ad Manager.\n\nSummary\n-------\n\nBanner views occupy a spot within an app's layout. They stay on screen while users are interacting with the app.\n\n### Inheritance\n\nInherits from: [GoogleMobileAds.Api.BannerView](/admob/unity/reference/class/google-mobile-ads/api/banner-view)\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AdManagerBannerView](#class_google_mobile_ads_1_1_api_1_1_ad_manager_1_1_ad_manager_banner_view_1a38f47cf484b1327525dc6d42637225ec)`(string adUnitId, `[AdSize](/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size)` adSize, `[AdPosition](/admob/unity/reference/namespace/google-mobile-ads/api#namespace_google_mobile_ads_1_1_api_1a228f8d5fe7b1ef40558cb59eac9befbd)` position)` Creates an Ad Manager banner view with a standard position. ||\n| [AdManagerBannerView](#class_google_mobile_ads_1_1_api_1_1_ad_manager_1_1_ad_manager_banner_view_1a2a5f8cace529a1cf7da46f1eb322823a)`(string adUnitId, `[AdSize](/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size)` adSize, int x, int y)` Creates an Ad Manager banner view with a custom position. ||\n\n| ### Events ||\n|-------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [OnAppEventReceived](#class_google_mobile_ads_1_1_api_1_1_ad_manager_1_1_ad_manager_banner_view_1a347b100ff5754d019281e2d413123d51) | `Action\u003c `[AppEvent](/admob/unity/reference/class/google-mobile-ads/api/ad-manager/app-event#class_google_mobile_ads_1_1_api_1_1_ad_manager_1_1_app_event)` \u003e` Raised when the app receives an event from the banner ad. |\n\n| ### Properties ||\n|-------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ValidAdSizes](#class_google_mobile_ads_1_1_api_1_1_ad_manager_1_1_ad_manager_banner_view_1a9925e76bfc4183c616047e01d8c4ab8a) | `List\u003c `[AdSize](/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size)` \u003e` Sets the supported sizes of the banner ad. |\n\nEvents\n------\n\n### OnAppEventReceived\n\n```c#\nAction\u003c AppEvent \u003e OnAppEventReceived\n``` \nRaised when the app receives an event from the banner ad.\n\nProperties\n----------\n\n### ValidAdSizes\n\n```c#\nList\u003c AdSize \u003e ValidAdSizes\n``` \nSets the supported sizes of the banner ad.\n\nIn most cases, only one ad size will be specified. Use one of the predefined standard ad sizes (such as [AdSize.MediumRectangle](/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a744724a26d59f412bf0279d3c7b7cb88)), or create one by specifying width and height.\n\nMultiple ad sizes can be specified if your application can appropriately handle multiple ad sizes. For example, your application might read [ValidAdSizes](/admob/unity/reference/class/google-mobile-ads/api/ad-manager/ad-manager-banner-view#class_google_mobile_ads_1_1_api_1_1_ad_manager_1_1_ad_manager_banner_view_1a9925e76bfc4183c616047e01d8c4ab8a) during the [AdManagerBannerView::OnBannerAdLoaded](/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a098b6c438df081b1ee64270b0038dc53) callback and change the layout according to the size of the ad that was loaded. If multiple ad sizes are specified, the [AdManagerBannerView](/admob/unity/reference/class/google-mobile-ads/api/ad-manager/ad-manager-banner-view#class_google_mobile_ads_1_1_api_1_1_ad_manager_1_1_ad_manager_banner_view) will assume the size of the first ad size until an ad is loaded.\n\nThis method also immediately resizes the currently displayed ad, so calling this method after an ad has been loaded is not recommended unless you know for certain that the content of the ad will render correctly in the new ad size. This can be used if an ad needs to be resized after it has been loaded. If more than one ad size is specified, the currently displayed ad will be resized to the first ad size.\n\nPublic functions\n----------------\n\n### AdManagerBannerView\n\n```c#\n AdManagerBannerView(\n string adUnitId,\n AdSize adSize,\n AdPosition position\n)\n``` \nCreates an Ad Manager banner view with a standard position. \n\n### AdManagerBannerView\n\n```c#\n AdManagerBannerView(\n string adUnitId,\n AdSize adSize,\n int x,\n int y\n)\n``` \nCreates an Ad Manager banner view with a custom position."]]