A Godot plugin that provides a unified GDScript interface for integrating Google Mobile Ads SDK on Android and iOS.
Key Features:
- Load and show...
- Banner Ads
- Interstitial Ads
- Rewarded Video Ads
- Rewarded Interstitial Ads
- App Open Ads
- Emits signals when ads are loaded, viewed, clicked, dismissed, rewards received, & more
- Allows configuration of all settings on a node
- Works with Google AdMob ad network by default
- Allows enabling of 15 additional ad networks
- Provides two export configuration options:
- Node-based
- File-based
- Prerequisites
- Installation
- Usage
- Signals
- Banner Ads
- App Open Ads
- User Consent
- Multi-scene Projects
- Mediation
- Export
- Platform-Specific Notes
- Video Tutorials
- Links
- All Plugins
- Credits
- Contributing
Create an AdMob account at the following link:
Using the AdMob console:
- create an app and link it to the app's store listing
- create ad(s) for your app via the AdMob console
- if needed, create consent form(s) for your app via the AdMob console
Before installing this plugin, make sure to uninstall any previous versions of the same plugin.
If installing both Android and iOS versions of the plugin in the same project, then make sure that both versions use the same addon interface version.
There are 2 ways to install the Admob plugin into your project:
- Through the Godot Editor's AssetLib
- Manually by downloading archives from Github
Steps:
- search for and select the
Admobplugin in Godot Editor - click
Downloadbutton - on the installation dialog...
- keep
Change Install Foldersetting pointing to your project's root directory - keep
Ignore asset rootcheckbox checked - click
Installbutton
- keep
- enable the plugin via the
Pluginstab ofProject->Project Settings...menu, in the Godot Editor
When installing via AssetLib, the installer may display a warning that states "[x number of] files conflict with your project and won't be installed." You can ignore this warning since both versions use the same addon code.
Steps:
- download release archive from Github
- unzip the release archive
- copy to your Godot project's root directory
- enable the plugin via the
Pluginstab ofProject->Project Settings...menu, in the Godot Editor
The following ad types are supported:
- Banner
- Interstitial
- Rewarded
- Rewarded Interstitial
- App Open
- Add
Admobnode to your main scene and populate the ID fields of the node- Debug IDs will only be used when your Godot app is run in debug mode
- Real IDs will only be used when the
is_realfield of the node is set totrue
- initialize the plugin
- call the
initialize()method of theAdmobnode - wait for the
initialization_completedsignal
- call the
- use one or more of the following
load_*()methods to load ads from theAdmobnode:load_banner_ad(ad_request: LoadAdRequest)load_interstitia_adl(ad_request: LoadAdRequest)load_rewarded_ad(ad_request: LoadAdRequest)load_rewarded_interstitial_ad(ad_request: LoadAdRequest)load_app_open_ad(ad_unit_id: String, auto_show_on_resume: boolean)
- the
Admobnode will emit the following signals once ads have been loaded or failed to load:banner_ad_loaded(ad_id: String)banner_ad_failed_to_load(ad_id: String, error_data: LoadAdError)interstitial_ad_loaded(ad_id: String)interstitial_ad_failed_to_load(ad_id: String, error_data: LoadAdError)rewarded_ad_loaded(ad_id: String)rewarded_ad_failed_to_load(ad_id: String, error_data: LoadAdError)rewarded_interstitial_ad_loaded(ad_id: String)rewarded_interstitial_ad_failed_to_load(ad_id: String, error_data: LoadAdError)app_open_ad_loaded(ad_unit_id: String)app_open_ad_failed_to_load(ad_unit_id: String, error_data: LoadAdError)
- once ads have been loaded, call corresponding
show_*()method from theAdmobnode with thead_idreceived:show_banner_ad(ad_id: String)show_interstitial_ad(ad_id: String)show_rewarded_ad(ad_id: String)show_rewarded_interstitial_ad(ad_id: String)show_app_open_ad()
- register listeners for one or more of the following signals of the
Admobnode:initialization_completed(status_data: InitializationStatus)banner_ad_loaded(ad_id: String, response_info: ResponseInfo)banner_ad_failed_to_load(ad_id: String, error_data: LoadAdError)banner_ad_refreshed(ad_id: String, response_info: ResponseInfo)banner_ad_clicked(ad_id: String)banner_ad_impression(ad_id: String)banner_ad_opened(ad_id: String)banner_ad_closed(ad_id: String)interstitial_ad_loaded(ad_id: String, response_info: ResponseInfo)interstitial_ad_failed_to_load(ad_id: String, error_data: LoadAdError)interstitial_ad_refreshed(ad_id: String, response_info: ResponseInfo)interstitial_ad_impression(ad_id: String)interstitial_ad_clicked(ad_id: String)interstitial_ad_showed_full_screen_content(ad_id: String)interstitial_ad_failed_to_show_full_screen_content(ad_id: String, error_data: AdError)interstitial_ad_dismissed_full_screen_content(ad_id: String)rewarded_ad_loaded(ad_id: String, response_info: ResponseInfo)rewarded_ad_failed_to_load(ad_id: String, error_data: LoadAdError)rewarded_ad_impression(ad_id: String)rewarded_ad_clicked(ad_id: String)rewarded_ad_showed_full_screen_content(ad_id: String)rewarded_ad_failed_to_show_full_screen_content(ad_id: String, error_data: AdError)rewarded_ad_dismissed_full_screen_content(ad_id: String)rewarded_ad_user_earned_reward(ad_id: String, reward_data: RewardItem)rewarded_interstitial_ad_loaded(ad_id: String, response_info: ResponseInfo)rewarded_interstitial_ad_failed_to_load(ad_id: String, error_data: LoadAdError)rewarded_interstitial_ad_impression(ad_id: String)rewarded_interstitial_ad_clicked(ad_id: String)rewarded_interstitial_ad_showed_full_screen_content(ad_id: String)rewarded_interstitial_ad_failed_to_show_full_screen_content(ad_id: String, error_data: AdError)rewarded_interstitial_ad_dismissed_full_screen_content(ad_id: String)rewarded_interstitial_ad_user_earned_reward(ad_id: String, reward_data: RewardItem)app_open_ad_loaded(ad_unit_id: String, response_info: ResponseInfo)app_open_ad_failed_to_load(ad_unit_id: String, error_data: LoadAdError)app_open_ad_impression(ad_unit_id: String)app_open_ad_clicked(ad_unit_id: String)app_open_ad_showed_full_screen_content(ad_unit_id: String)app_open_ad_failed_to_show_full_screen_content(ad_unit_id: String, error_data: AdError)app_open_ad_dismissed_full_screen_content(ad_unit_id: String)consent_form_loadedconsent_form_dismissed(error_data: FormError)consent_form_failed_to_load(error_data: FormError)consent_info_updatedconsent_info_update_failed(error_data: FormError)
Banner ads can be categorized as:
- Adaptive Banner Ads
- Fixed-size Banner Ads
- Collapsible Banner Ads
Banner position can be set to the following values:
- TOP
- BOTTOM
- LEFT
- RIGHT
- TOP-LEFT
- TOP-RIGHT
- BOTTOM-LEFT
- BOTTOM-RIGHT
- CENTER
- The following methods return the size of a Banner ad:
get_banner_dimension()get_banner_dimension_in_pixels()
- These methods are not supported for
FLUIDsized ads. For banner ads of sizeFLUID, theget_banner_dimension()method will return(-3, -4)and theget_banner_dimension_in_pixels()method will return(-1, -1).
Collapsible banner ads are banner ads that are initially presented as a larger overlay with a button to collapse them to their originally-requested banner size. Collapsible banner ads can be requested by setting the collapsible position value to TOP or BOTTOM.
Note that if collapsible position value is in conflict with the banner position value, then the collapsible banner ad may not function as intended. Set banner position and collapsible position to the same value for the best experience.
App open ads are a special ad format intended for publishers wishing to monetize their app load screens. App open ads can be closed at any time, and are designed to be shown at startup or when your users bring your app to the foreground.
Set auto_show_on_resume to true in order to show app open ads when users resume (bring from background to foreground) your app. The app open ad should be loaded via the load_app_open_ad() method before it can be displayed at startup or upon resumption. Ideally, invoke the load_app_open_ad() method at startup and, if auto_show_on_resume is enabled, upon each app_open_ad_impression signal.
- Methods:
get_consent_status()- Returns a consent status value defined inConsentInformation.gdupdate_consent_info(params: ConsentRequestParameters)- To be called ifget_consent_status()returns status UNKNOWN.reset_consent_info()- To be used only when testing and debugging your application.is_consent_form_available()load_consent_form()- To be called ifget_consent_status()returns status REQUIRED andis_consent_form_available()returnsfalse.show_consent_form()- To be called afterconsent_form_loadedsignal has been emitted oris_consent_form_available()returnstrue.
The recommended way to use the Admob Plugin in a multi-scene Godot project is as follows:
- Create a new scene for managing Ads (ie. named
AdManager).- Attach a script to the root node
- Add an
Admobnode to the new scene@onready, link to anadmob_nodevariable
- Connect all signals and keep all ad logic in this script
- From Godot Editor's
Project->Project Settings...menu, select theGlobalstab- Set this new scene as an
Autoload
- Set this new scene as an
After setting this scene as an Autoload, the Admob Plugin methods can be invoked from any scene as shown in the following example:
AdManager.admob_node.show_banner()
Admob Plugin's mediation feature allows selection of up to 15 additional ad mediation networks to serve your ads. For efficiency, the plugin will only add the SDKs of enabled networks to your app.
Admob Plugin makes the following ad networks available:
- Google AdMob (enabled by default)
- AppLovin
- Chartboost
- DT Exchange
- i-mobile
- InMobi
- ironSource
- Liftoff Monetize
- LINE Ads Network
- maio
- Meta Audience Network
- Mintegral
- Moloco
- myTarget
- Pangle
- Unity Ads
The networks that you choose will also need to be enabled via your AdMob Console for them to be available to your app.
Both Android and iOS exports require several configuration settings.
In order to enable file-based export configuration, an android_export.cfg or an ios_export.cfg file should be placed in the addons/AdmobPlugin directory with the file contents formatted as in the example below:
[General]
is_real = false
[Debug]
app_id = "ca-app-pub-3940256099942544~3347511713"
[Release]
app_id = "ca-app-pub-3940256099942544~3347511713"
[Mediation]
enabled_networks = ["applovin", "unity"]
The ios_export.cfg file supports the following additional properties, which are not relevant for Android.
[ATT]
att_enabled = true
att_text = "My ATT text."
The is_real and app_id configuration items are mandatory and if not found in the export.cfg file, then the plugin will fall back to node-based configuration.
If <platform>_export.cfg file is not found for the target platform or file-based configuration fails, then the plugin will attempt to load node-based configuration.
During export, the plugin searches for an Admob node in the scene that is open in the Godot Editor. If not found, then the plugin searches for an Admob node in the project's main scene. Therefore;
- Make sure that the scene that contains the
Admobnode is selected in the Godot Editor when building and exporting, or - Make sure that your Godot project's main scene contains an
Admobnode
- Download Android export template and enable gradle build from export settings
- Missing APP ID:
- If your game crashes due to missing APP ID, then make sure that you
- enter your Admob APP ID in the Admob node and pay attention to the Android Export section.
- or enter it in the
android_export.cfgfile as described in the File-based Export section.
- If your game crashes due to missing APP ID, then make sure that you
- Troubleshooting:
- Logs:
adb logcat | grep 'godot'(Linux),adb.exe logcat | select-string "godot"(Windows) - You may find the following resources helpful:
- Logs:
- Follow instructions on Exporting for iOS
- Missing APP ID crashes: make sure that you
- enter your Admob APP ID in the Admob node and pay attention to the iOS Export section.
- or enter it in the
android_export.cfgfile as described in the File-based Export section.
- View XCode logs while running the game for troubleshooting.
- See Godot iOS Export Troubleshooting.
- App Tracking Transparency, or ATT for short, is Apple's opt-in privacy framework that requires all iOS apps to ask users for permission to share their data. This is done in the form of a popup where users can either consent or deny tracking.
- To enable ATT in your app
- Enter a descriptive text that will be displayed on the ATT dialog in your
Admobnode'satt_textfield. - Call
Admobnode'srequest_tracking_authorization()method. - Handle
Admobnode'stracking_authorization_grantedandtracking_authorization_deniedsignals. - If the user initially rejects the tracking request, then later on you can check if the user changed their mind and allow them to update their settings by opening the system app settings using the
Admobnode'sopen_app_settings()method.
- Enter a descriptive text that will be displayed on the ATT dialog in your
- To enable ATT in your app
Admob Plugin on Android -- by 16BitDev
Consent Management with the Admob Plugin -- by Code Artist
Admob Plugin on Android -- by Code Artist
| Plugin | Android | iOS | Free | Open Source | License |
|---|---|---|---|---|---|
| Notification Scheduler | ✅ | ✅ | ✅ | ✅ | MIT |
| Admob | ✅ | ✅ | ✅ | ✅ | MIT |
| Deeplink | ✅ | ✅ | ✅ | ✅ | MIT |
| Share | ✅ | ✅ | ✅ | ✅ | MIT |
| In-App Review | ✅ | ✅ | ✅ | ✅ | MIT |
Developed by Cengiz
Android part is based on Shin-NiL's Godot Admob Plugin
iOS part is based on Godot iOS Plugin Template
Original repository: Godot Admob Plugin
This section provides information on how to build the plugin for contributors.
- Run
./script/build.sh -R-- creates all 3 archives in the./releasedirectory
- Run
./ios/script/build.sh -A <godot version>initially to run a full build - Run
./ios/script/build.sh -cgA <godot version>to clean, redownload Godot, and rebuild - Run
./ios/script/build.sh -cato clean and build without redownloading Godot - Run
./ios/script/build.sh -hfor more information on the build script
Options:
- Use Android Studio to build via Build->Assemble Project menu
- Switch Active Build Variant to release and repeat
- Run packageDistribution task to create release archive
- Use project-root-level build.sh script
./script/build.sh -ca- clean existing build, do a debug build for Android./script/build.sh -carz- clean existing build, do a release build for Android, and create archive




