Google Ad Manager Native Ad Layout¶
Category | Requires | Version |
---|---|---|
Monetization > Advertising | API 21, Android 5.0 Lollipop | 1 |
Overview¶
A layout component for showing native ads from Google Ad Manager.
Note: This component is currently available on an invite-only basis. Click here for more information on how to request an invite.
Permissions
Events¶
Ad Clicked¶
Called when the user clicks on the ad.
Ad Closed¶
Called when the ad is closed, and the user is returned to the app.
Ad Failed To Load¶
Called when an ad fails to load. The error code and message provide more details on the failure.
Params | |
---|---|
error Code | Number |
error Message | Text |
Ad Impression¶
Called when an ad impression has been recorded.
Ad Loaded¶
Called when an ad has been successfully loaded and is ready to be shown. The "asset Dictionary" parameter contains native ad assets, like advertiser, price, etc. You can access these assetsusing the "get value for key in dictionary" block under the "Dictionaries" category of blocks. Use the appropriate "NativeAdAssetKey" helper block as the key.
Params | |
---|---|
asset Dictionary | Dictionary |
Ad Opened¶
Called when the ad is displayed on the screen, covering the app's content.
Ad Swipe Gesture Clicked¶
Called when the user performs a swipe gesture click on the ad.
Methods¶
Load Ad¶
Initiates a request to load a new native ad. This will not do anything if an ad is already loading or if ads are disabled.
Properties¶
Ad Enabled¶
Boolean Default: True Read Write - Designer Blocks
Specifies whether ads should be enabled. If set to false, no ads will be loaded or shown.
Ad Unit ID¶
Text Read Write - Designer Blocks
The Ad Unit ID for this banner ad. It can be found in your AdMob account.
Body Label¶
Component Write - Designer Blocks
The label component that should be used to display the body text of the ad.
Call To Action Button¶
Component Write - Designer Blocks
The button component that should be used as call-to-action button of the ad.
eCPM Floor¶
Com.google.appinventor.components.common.flooramountenum Default: optimized Read Write - Designer Blocks
Set a minimum eCPM floor below which advertisers cannot bid for inventory. Use Optimized to let Google decide an eCPM floor.
Headline Label¶
Component Write - Designer Blocks
The label component that should be used to display the headline of the ad.
Height¶
Number Read Write - Blocks
Specifies the component's vertical height, measured in pixels.
Height Percent¶
Number Write - Blocks
Specifies the component's vertical height as a percentageof the height of its parent Component.
Icon Image¶
Component Write - Designer Blocks
The image component that should be used to display the icon of the ad.
Test Mode¶
Boolean Default: False Write - Designer
If enabled, test ads will be shown. This should be used during development to avoid generating false impressions. Always enabled when in companion.
Visible¶
Boolean Default: True Read Write - Designer Blocks
Returns true iff the component is visible.
Width¶
Number Read Write - Blocks
Specifies the component's horizontal width, measured in pixels.
Width Percent¶
Number Write - Blocks
Specifies the component's horizontal width as a percentageof the Width of its parent Component.