On this page15 sections
Lecture 010 — Going Live: Real Ids & Policies
| Category | 4 — Going Live |
| Lecture | 010 of 010 |
| Estimated video length | 20 min |
| Target | Flutter 3.44 · Dart 3.12 · google_mobile_ads 9 |
| Level | Beginner |
| Source code | GitHub — urraan_admob_final |
Everything so far used test ads. To earn, create your app in AdMob, create ad units, put the real ids in
AdmobManagerand follow the policies that keep your account safe.
Contents
Prerequisites · Connection · Objectives · Lesson · Code Examples · Common Mistakes · Best Practices · Mini Challenge · Practice Questions · Answers · Takeaways
Prerequisites
All previous lectures.
Connection With Previous Lectures
The demo is complete and tested. This last lecture is the checklist from "works on my phone" to "earns".
Learning Objectives
By the end of this lecture you will be able to:
- Create an AdMob account, app and ad units
- Replace the sample app ids and fill the real-id maps
- Test with your own device safely
- Follow the key policies
Lesson
1. The Steps
- Sign in at admob.google.com with your Google account.
- Apps → Add app. Choose Android or iOS and say whether it is published on a store.
- AdMob shows your app id (
~). Replace the sample id inAndroidManifest.xml/Info.plist. - Ad units → Add ad unit for each format. Copy each ad unit id (
/). - Paste them into
_androidIds/_iosIdsinAdmobManager. - Set up Privacy & messaging (consent message) and Payments (address, bank).
2. Test Safely With Real Ids
Add your phone as a test device in the AdMob dashboard (Settings → Test devices) or with
MobileAds.instance.updateRequestConfiguration(...) and the device id printed in the log.
Then even real ids show test ads on that device.
3. Policy Checklist
- Never tap your own ads or ask others to.
- Do not place ads so users tap them by accident (banner next to buttons, overlays).
- Do not show interstitials at app start, on exit, or during a task.
- Describe a rewarded ad honestly before it plays.
- Have a privacy policy and mention the ads in it.
- Keep ad content appropriate for your audience; apps for children need special settings.
4. Before Release
| Check | Done |
|---|---|
| App ids replaced (Android + iOS) | ☐ |
| All ad unit ids filled in both maps | ☐ |
showTestAdsInDebug is fine for release (the release build ignores it) | ☐ |
| Consent message published | ☐ |
| Tested a release build on a test device | ☐ |
Code Examples
Example 1 — Release Build
flutter build appbundle --releaseInstall the release build and confirm ads load (as test ads on your test device) before uploading to the store.
Common Beginner Mistakes
1. Leaving the sample app id in a release — no revenue; AdMob cannot match the app.
2. Empty ad unit ids — nothing loads.
3. Testing with real ads without a test device — risks invalid traffic.
4. No privacy policy — stores and AdMob can reject the app.
Best Practices
- Use separate ad units per placement to compare earnings
- Add yourself as a test device before touching real ids
- Re-read the AdMob policies before each major release
Mini Challenge
Make a checklist file in your own project with the table above and tick it before each release.
Practice Questions
- What replaces the sample app id?
- Where do ad unit ids go in code?
- How do you test real ids safely?
- Name two policy rules.
Practice Answers
- The app id from your AdMob dashboard.
- In
_androidIds/_iosIdsofAdmobManager. - Register a test device.
- Never tap your own ads; no interstitials during a task.
Key Takeaways
- Real ids come from the AdMob dashboard
- Test device first, then real ids
- Follow policies to keep the account safe