# GoogleMobileAds.Api.BannerView

Banner views occupy a spot within an app's layout.

## Summary

They stay on screen while users are interacting with the app.

### Inheritance

Direct Known Subclasses:[GoogleMobileAds.Api.AdManager.AdManagerBannerView](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-manager/ad-manager-banner-view)

| ### Constructors and Destructors ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a2197c2472e403bb6153e947ef278a8e4(string adUnitId, https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size adSize, https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/api#namespace_google_mobile_ads_1_1_api_1a228f8d5fe7b1ef40558cb59eac9befbd position)` Creates a banner view with a standard position. ||
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1ab1b2a6a603092a56978b6008856b5fd6(string adUnitId, https://developers.google.com/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 a banner view with a custom position. ||

| ### Events ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a22e290556ca5fc8f948249904c3a1997` | `Action` Raised when an ad is clicked. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1ad3c164fa142a04974c58137ef6a6813e` | `Action` Raised when the ad closed full-screen content. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a27b5e6e195ac458db7c7e0a43f73bf96` | `Action` Raised when an ad opened full-screen content. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1adaaa83bff9790b3f4041d9aa6845e944` | `Action` Raised when an impression is recorded for an ad. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a9b5ff0086d6f013f213f5a2eab0abcdb` | `Action< https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-value#class_google_mobile_ads_1_1_api_1_1_ad_value >` Raised when the ad is estimated to have earned money. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a4ff00417cdbb177343e5205670f81ecc` | `Action< https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/load-ad-error#class_google_mobile_ads_1_1_api_1_1_load_ad_error >` Raised when an ad fails to load into the banner view. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a098b6c438df081b1ee64270b0038dc53` | `Action` Raised when an ad is loaded into the banner view. |

| ### Properties ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a5f0424b186e65519f3d054ba0f23df81` | `bool` Returns true if [Destroy()](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a9ed6f4426f89f6ad299c8c636fdcdd33) has been called. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1af9f6f994aba38a0cd10e39aac8b7d525` | `long` A long integer provided by the AdMob UI for the configured placement. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a9ed6f4426f89f6ad299c8c636fdcdd33()` | `void` Destroys the banner view. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a4887e1289f4c3cc2b8b88d782cac3a62()` | `string` Returns the ad unit ID. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a036be437fe3fe1913f483fd484509ebc()` | `float` Returns the height of the banner view in pixels. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a17345302d24128376a662a9dbc0bd4b1()` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/response-info#class_google_mobile_ads_1_1_api_1_1_response_info` Returns the ad request response info or null if the ad is not loaded. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a1ba25677907c714b073b1394262ac56f()` | `float` Returns the width of the banner view in pixels. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1af53e468bdcda2ef3481745f7f0afc03f()` | `void` Hides the banner view. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a21c3e10e803fed80bfd8977d376c148b()` | `bool` Indicates whether the last loaded ad is a collapsible banner. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1aff65b51046fd47c8a25414c8cdd96dac(https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-request#class_google_mobile_ads_1_1_api_1_1_ad_request request)` | `void` Loads an ad into the banner view. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1ae0603ff7edaf8aa5d5a85f13d1522314(https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/api#namespace_google_mobile_ads_1_1_api_1a228f8d5fe7b1ef40558cb59eac9befbd adPosition)` | `void` Sets the position of the banner view using standard position. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a5d61e9a1a5327d990c3815a0a28308a5(int x, int y)` | `void` Sets the position of the banner view using custom position. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1ace09e149d26cb2b296824af83c629ff4()` | `void` Shows the banner view. |

## Events

### OnAdClicked

```c#
Action OnAdClicked
```
Raised when an ad is clicked.

### OnAdFullScreenContentClosed

```c#
Action OnAdFullScreenContentClosed
```
Raised when the ad closed full-screen content.

On iOS, this event is only raised when an ad opens an overlay, not when opening a new application such as Safari or the App Store.

### OnAdFullScreenContentOpened

```c#
Action OnAdFullScreenContentOpened
```
Raised when an ad opened full-screen content.

### OnAdImpressionRecorded

```c#
Action OnAdImpressionRecorded
```
Raised when an impression is recorded for an ad.

### OnAdPaid

```c#
Action< AdValue > OnAdPaid
```
Raised when the ad is estimated to have earned money.

### OnBannerAdLoadFailed

```c#
Action< LoadAdError > OnBannerAdLoadFailed
```
Raised when an ad fails to load into the banner view.

### OnBannerAdLoaded

```c#
Action OnBannerAdLoaded
```
Raised when an ad is loaded into the banner view.

## Properties

### IsDestroyed

```c#
bool IsDestroyed
```
Returns true if [Destroy()](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/banner-view#class_google_mobile_ads_1_1_api_1_1_banner_view_1a9ed6f4426f89f6ad299c8c636fdcdd33) has been called.

### PlacementId

```c#
long PlacementId
```
A long integer provided by the AdMob UI for the configured placement.

To ensure this placement ID is included in reporting, set a value before loading the ad. The default value of 0 also indicates the placement ID is not set.

## Public functions

### BannerView

```c#
 BannerView(
  string adUnitId,
  AdSize adSize,
  AdPosition position
)
```
Creates a banner view with a standard position.

### BannerView

```c#
 BannerView(
  string adUnitId,
  AdSize adSize,
  int x,
  int y
)
```
Creates a banner view with a custom position.

### Destroy

```c#
void Destroy()
```
Destroys the banner view.

### GetAdUnitID

```c#
string GetAdUnitID()
```
Returns the ad unit ID.

### GetHeightInPixels

```c#
float GetHeightInPixels()
```
Returns the height of the banner view in pixels.

### GetResponseInfo

```c#
ResponseInfo GetResponseInfo()
```
Returns the ad request response info or null if the ad is not loaded.

### GetWidthInPixels

```c#
float GetWidthInPixels()
```
Returns the width of the banner view in pixels.

### Hide

```c#
void Hide()
```
Hides the banner view.

### IsCollapsible

```c#
bool IsCollapsible()
```
Indicates whether the last loaded ad is a collapsible banner.

### LoadAd

```c#
void LoadAd(
  AdRequest request
)
```
Loads an ad into the banner view.

### SetPosition

```c#
void SetPosition(
  AdPosition adPosition
)
```
Sets the position of the banner view using standard position.

### SetPosition

```c#
void SetPosition(
  int x,
  int y
)
```
Sets the position of the banner view using custom position.

### Show

```c#
void Show()
```
Shows the banner view.