# GoogleMobileAds.Api.NativeOverlayAd

Native Overlay ads use the Native ad format to show overlays on top of the application.

## Summary

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

| ### Events ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a873d7111668e82cab7aa3a02e03866f4` | `Action` Raised when a click is recorded for an ad. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a094db804dcc678f28ac58faf51135cb4` | `Action` Raised when the ad closed full-screen content. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1affccaddc3abc380528f6a86b3bdcd908` | `Action` Raised when an ad opened full-screen content. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1aed14b8002f25fd43eb2b5188ec80ebcb` | `Action` Raised when an impression is recorded for an ad. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1ac7db171a9542f48cdbbc6db87fcad4ee` | `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. |

| ### Properties ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a9c1f3c4a2504d5cbf6731e2a4a9b2c5c` | `long` A long integer provided by the AdMob UI for the configured placement. |

| ### Public static functions ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a0bdcacc811d18ba39e8e5e00f6770bbe(string adUnitId, 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, https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-ad-options#class_google_mobile_ads_1_1_api_1_1_native_ad_options options, Action< https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad, 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 > adLoadCallback)` | `void` Loads a native overlay ad. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1afd5775ad34006efb0891925e06507dda()` | `void` Destroys the native overlay ad. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a89487d3d6be0b980e2100759336d1e8c()` | `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` Fetches the ad request response info. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a34f913bcd79e8f92e97c12fbddfb3824()` | `float` Returns the height of the native overlay in pixels. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a358d713567dd8e4afc5f15135f9929e3()` | `float` Returns the width of the native overlay in pixels. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a48ce948f8e56b3969cd01d002472350a()` | `void` Hides the ad from being shown. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a60a252908055d825e98d5b1b0acc2fad(https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-template-style#class_google_mobile_ads_1_1_api_1_1_native_template_style nativeTemplateStyle, 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 adPosition)` | `void` Renders the native overlay ad at provided AdPosition with the given adSize. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1acc4959058fac7aa570ba19507ae98e50(https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-template-style#class_google_mobile_ads_1_1_api_1_1_native_template_style nativeTemplateStyle, 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)` | `void` Renders the native overlay ad at x,y coordinates with the provided size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a6c1a6aa4d0d9605d76fb374103168112(https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-template-style#class_google_mobile_ads_1_1_api_1_1_native_template_style nativeTemplateStyle, https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/api#namespace_google_mobile_ads_1_1_api_1a228f8d5fe7b1ef40558cb59eac9befbd adPosition)` | `void` Renders the native overlay ad at provided AdPosition using the default size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1ab5c486124bfe65a2ec5ce4db9f3c390e(https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-template-style#class_google_mobile_ads_1_1_api_1_1_native_template_style nativeTemplateStyle, int x, int y)` | `void` Renders the native Overlay ad at x,y coordinates using the default size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a79a95d48eda460e6990719c4596ec074(https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/api#namespace_google_mobile_ads_1_1_api_1a228f8d5fe7b1ef40558cb59eac9befbd position)` | `void` Sets the position of the native overlay ad using standard position. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1afaa8015d323b35c2bc3e9cb5cc583432(int x, int y)` | `void` Sets the position of the native overlay ad using custom position. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/native-overlay-ad#class_google_mobile_ads_1_1_api_1_1_native_overlay_ad_1a64f2203c74a3e5c3dd4720e330ae1186()` | `void` Shows the previously hidden ad. |

## Events

### OnAdClicked

```c#
Action OnAdClicked
```
Raised when a click is recorded for an ad.

### 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.

## Properties

### 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 showing the ad.

## Public static functions

### Load

```c#
void Load(
  string adUnitId,
  AdRequest request,
  NativeAdOptions options,
  Action< NativeOverlayAd, LoadAdError > adLoadCallback
)
```
Loads a native overlay ad.

<br />

Details Parameters `adUnitId` An ad unit ID created in the AdMob or Ad Manager UI. `request` An ad request object containing targeting information used to fetch the ad. `options` Native Ad Options for configuring image and video rendering settings. `adLoadCallback` Callback to inform the app if the load request was successful or failed to fetch the ad.

## Public functions

### Destroy

```c#
void Destroy()
```
Destroys the native overlay ad.

### GetResponseInfo

```c#
ResponseInfo GetResponseInfo()
```
Fetches the ad request response info.

<br />

| Details ||
|---|---|
| **Returns** | The ad request response info or null if the ad is not loaded. |

### GetTemplateHeightInPixels

```c#
float GetTemplateHeightInPixels()
```
Returns the height of the native overlay in pixels.

### GetTemplateWidthInPixels

```c#
float GetTemplateWidthInPixels()
```
Returns the width of the native overlay in pixels.

### Hide

```c#
void Hide()
```
Hides the ad from being shown.

### RenderTemplate

```c#
void RenderTemplate(
  NativeTemplateStyle nativeTemplateStyle,
  AdSize adSize,
  AdPosition adPosition
)
```
Renders the native overlay ad at provided AdPosition with the given adSize.

<br />

Details Parameters `nativeTemplateStyle` The Template styling used to customize the native ad. `adSize` The size of the overlay used to render the native ad. `adPosition` The position of the overlay in screen space.

### RenderTemplate

```c#
void RenderTemplate(
  NativeTemplateStyle nativeTemplateStyle,
  AdSize adSize,
  int x,
  int y
)
```
Renders the native overlay ad at x,y coordinates with the provided size.

<br />

Details Parameters `nativeTemplateStyle` The Template styling used to customize the native ad. `adSize` The size of the overlay used to render the native ad. `x` The x coordinate position of the overlay in screen space. `y` The y coordinate position of the overlay in screen space.

### RenderTemplate

```c#
void RenderTemplate(
  NativeTemplateStyle nativeTemplateStyle,
  AdPosition adPosition
)
```
Renders the native overlay ad at provided AdPosition using the default size.

<br />

Details Parameters `nativeTemplateStyle` The Template styling used to customize the native ad. `adPosition` The position of the overlay in screen space.

### RenderTemplate

```c#
void RenderTemplate(
  NativeTemplateStyle nativeTemplateStyle,
  int x,
  int y
)
```
Renders the native Overlay ad at x,y coordinates using the default size.

<br />

Details Parameters `nativeTemplateStyle` The Template styling used to customize the native ad. `x` The x coordinate position of the overlay in screen space. `y` The y coordinate position of the overlay in screen space.

### SetTemplatePosition

```c#
void SetTemplatePosition(
  AdPosition position
)
```
Sets the position of the native overlay ad using standard position.

<br />

Details Parameters `position` The position of the overlay in screen space.

### SetTemplatePosition

```c#
void SetTemplatePosition(
  int x,
  int y
)
```
Sets the position of the native overlay ad using custom position.

<br />

Details Parameters `x` The x coordinate position of the overlay in screen space. `y` The y coordinate position of the overlay in screen space.

### Show

```c#
void Show()
```
Shows the previously hidden ad.