Your app can show Google AdMob ads with your own AdMob account, so the revenue goes to you. Ads are set up in the Ads step of Advanced Build. You can show them automatically without writing code, or control them from JavaScript with the ads API.
Ads need the Internet; the builder adds the required permissions when ads are on.
1. Start with test ads
- Open Advanced Build → Ads and turn on Enable AdMob ads.
- Turn on Use test ads.
- Turn on the formats you want (Banner, Interstitial, Rewarded) and build the APK.
Test ads use Google’s sample ad units and appear immediately, without an AdMob account. They earn nothing. Use them until your app works the way you want.
2. Create your AdMob app and ad units
- Sign in at AdMob (the Open AdMob button takes you there) and add an Android app.
- Copy the App ID. It looks like
ca-app-pub-1234567890123456~1234567890(with~). In AdMob: Apps → App settings. - Create an ad unit for each format you need and copy each Ad unit ID, such as
ca-app-pub-1234567890123456/1234567890(with/). - In the builder, turn off Use test ads and paste the App ID and unit IDs. The fields check the format and show an error for a wrong or mixed-up ID.
New AdMob accounts and apps can take a while before real ads are served. Never click your own live ads; AdMob can suspend the account. To see test ads on your own phone with real IDs, add your device ID to Test device IDs, one per line.
3. Choose the formats
Banner – a strip at the Top or Bottom of the screen. With Show automatically on, it appears when the app opens. Leave space in your layout so it does not cover buttons.
Interstitial – a full-screen ad.
- Load automatically keeps an ad ready.
- Show every (seconds): 0 (off), 30 s, 1, 2, 3 or 5 minutes, or a custom value. Ads then appear on that timer.
- Show every (page loads): show one after every N page loads; 0 means only when your code calls it.
- With both at 0, interstitials show only when you call
AndroidAPI.adsShowInterstitial().
Frequent interstitials annoy users and can break AdMob policy. A natural break, such as between game levels, triggered from JavaScript, is usually better than a short timer.
Rewarded – the user chooses to watch an ad for a reward such as coins or a hint. It is never shown automatically. Your page shows it with AndroidAPI.adsShowRewarded() and gives the reward on the rewardEarned event. Example: rewarded ads.
4. Privacy and consent (UMP)
Ads in the European Economic Area, the UK and some US states need user consent. Generated apps include Google’s User Messaging Platform (UMP):
- In AdMob, open Privacy & messaging and publish a GDPR message (and a US states message if you need it) for your app.
- The app shows that message before requesting ads, where it is required. Ads wait until the user answers.
- Give users a way to change their choice: show a “Privacy settings” button when
adsIsPrivacyOptionsRequired()returnstrue.
Under Ad privacy and age settings:
- Child-directed treatment (TFCD) – set to True if your app is directed at children.
- Under age of consent (TFUA) – set to True if your users may be under the age of consent in Europe.
- Maximum ad content rating – limit ads to content suitable for your audience.
- Unspecified keeps the SDK default.
These cannot be changed from HTML, so a page cannot bypass them.
Testing the consent form: with test ads on, Enable UMP testing lets you choose a UMP test geography (EEA, regulated US state, other region) and enter UMP test device hashes from the log. Emulators count as test devices automatically. These test options are ignored in builds with live ads.
5. Before publishing on Google Play
- Publish an
app-ads.txtfile on the developer website listed in your store listing, as AdMob instructs. - In Play Console App content, declare that the app contains ads and complete the advertising ID declaration.
- Check the Families policy if children are in your audience.
- Build the AAB with your real IDs and Use test ads off. Test ads in a published app earn nothing.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| No ads at all with real IDs | New AdMob app or unit not yet serving, wrong IDs, or App ID and unit IDs from different apps. Try test ads first. |
| Ads never load in Europe | The consent message is not published in AdMob, or the user has not answered it yet. |
adFailedToLoad with “no fill” |
No ad was available for that request. This is normal sometimes; try again later, not in a loop. |
| Banner covers the bottom button | Add bottom padding to your page when the banner is shown. |