Stay organized with collections
Save and categorize content based on your preferences.
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.
Action
Raised when a click is recorded for an ad.
Action
Raised when the ad closed full-screen content.
Action
Raised when an ad opened full-screen content.
Action
Raised when an impression is recorded for an ad.
Raised when the ad is estimated to have earned money.
void
Loads a native overlay ad.
void
Destroys the native overlay ad.
Fetches the ad request response info.
float
Returns the height of the native overlay in pixels.
float
Returns the width of the native overlay in pixels.
void
Hides the ad from being shown.
void
Renders the native overlay ad at provided AdPosition with the given adSize.
void
Renders the native overlay ad at x,y coordinates with the provided size.
void
Renders the native overlay ad at provided AdPosition using the default size.
void
Renders the native Overlay ad at x,y coordinates using the default size.
void
Sets the position of the native overlay ad using standard position.
void
Sets the position of the native overlay ad using custom position.
void
Shows the previously hidden ad.
Events
OnAdClicked
Action
OnAdClicked
Raised when a click is recorded for an ad.
OnAdFullScreenContentClosed
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
Action
OnAdFullScreenContentOpened
Raised when an ad opened full-screen content.
OnAdImpressionRecorded
Action
OnAdImpressionRecorded
Raised when an impression is recorded for an ad.
OnAdPaid
Action
<
AdValue
>
OnAdPaid
Raised when the ad is estimated to have earned money.
Public static functions
Load
void
Load
(
string
adUnitId
,
AdRequest
request
,
NativeAdOptions
options
,
Action
<
NativeOverlayAd
,
LoadAdError
>
adLoadCallback
)
Loads a native overlay ad.
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
void
Destroy
()
Destroys the native overlay ad.
GetResponseInfo
ResponseInfo
GetResponseInfo
()
Fetches the ad request response info.
GetTemplateHeightInPixels
float
GetTemplateHeightInPixels
()
Returns the height of the native overlay in pixels.
GetTemplateWidthInPixels
float
GetTemplateWidthInPixels
()
Returns the width of the native overlay in pixels.
Hide
void
Hide
()
Hides the ad from being shown.
RenderTemplate
void
RenderTemplate
(
NativeTemplateStyle
nativeTemplateStyle
,
AdSize
adSize
,
AdPosition
adPosition
)
Renders the native overlay ad at provided AdPosition with the given adSize.
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
void
RenderTemplate
(
NativeTemplateStyle
nativeTemplateStyle
,
AdSize
adSize
,
int
x
,
int
y
)
Renders the native overlay ad at x,y coordinates with the provided size.
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
void
RenderTemplate
(
NativeTemplateStyle
nativeTemplateStyle
,
AdPosition
adPosition
)
Renders the native overlay ad at provided AdPosition using the default size.
Parameters
nativeTemplateStyle
|
The Template styling used to customize the native ad.
|
adPosition
|
The position of the overlay in screen space.
|
RenderTemplate
void
RenderTemplate
(
NativeTemplateStyle
nativeTemplateStyle
,
int
x
,
int
y
)
Renders the native Overlay ad at x,y coordinates using the default size.
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
void
SetTemplatePosition
(
AdPosition
position
)
Sets the position of the native overlay ad using standard position.
Parameters
position
The position of the overlay in screen space.
SetTemplatePosition
void
SetTemplatePosition
(
int
x
,
int
y
)
Sets the position of the native overlay ad using custom position.
Parameters
x
|
The x coordinate position of the overlay in screen space.
|
y
|
The y coordinate position of the overlay in screen space.
|
Show
void
Show
()
Shows the previously hidden ad.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003eNative Overlay ads use the Native ad format to display overlays on top of your application, persisting on screen during user interaction.\u003c/p\u003e\n"],["\u003cp\u003eThese ads can be loaded using the \u003ccode\u003eLoad\u003c/code\u003e function, customized with \u003ccode\u003eNativeTemplateStyle\u003c/code\u003e, and positioned using \u003ccode\u003eSetTemplatePosition\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThey offer events like \u003ccode\u003eOnAdClicked\u003c/code\u003e, \u003ccode\u003eOnAdImpressionRecorded\u003c/code\u003e, and \u003ccode\u003eOnAdPaid\u003c/code\u003e to track user engagement and revenue.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can control the ad's visibility with \u003ccode\u003eShow\u003c/code\u003e and \u003ccode\u003eHide\u003c/code\u003e, and ultimately remove it using \u003ccode\u003eDestroy\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUtilize functions such as \u003ccode\u003eRenderTemplate\u003c/code\u003e to display the ad at specific coordinates or predefined positions within the app.\u003c/p\u003e\n"]]],["Native Overlay ads display within the app using the Native ad format. Key actions include loading ads with `Load`, providing `adUnitId`, `request`, `options`, and a callback. Ads can be rendered with `RenderTemplate` specifying style, size, and position, or set using `SetTemplatePosition`. They can be shown or hidden using `Show` and `Hide`, and are destroyed using `Destroy`. Information can be obtained via `GetResponseInfo` and `GetTemplateHeight/WidthInPixels`. Events such as `OnAdClicked`, `OnAdPaid`, etc are also available.\n"],null,[]]