App Development

AdMob Basics: A Complete Guide to Putting Ads in Your App

By Waseem Abbas Alvi · · About 7 min read

AdMob Basics: A Complete Guide to Putting Ads in Your App

If you want to keep your Android or iOS app free, ads are one common way to do it, and Google's AdMob is the most widely used platform for the job. In this article you will learn how to create an AdMob account, what the difference is between an App ID and an Ad unit ID, which ad formats exist, how to test, what app-ads.txt is, and which mistakes can put your account at risk.

We will not give any earnings figures here, because income depends on the country, the type of app, the users and many other things, and nothing is guaranteed. AdMob's rules also keep changing, so always check the AdMob Help Center for the latest information.

Creating an AdMob account

  1. Go to admob.google.com and sign up with your Google account. It is best to use an account you will keep for a long time, with 2-Step Verification turned on.
  2. Choose your country, time zone and currency. The country is not easy to change later, so pick it correctly.
  3. AdMob uses an AdSense payments profile for payments. If you already have an AdSense account in your name, it is usually best to link to that one, because Google expects one person to have only one payments profile. Creating duplicate accounts can cause problems later.
  4. Ads may be limited until your account is verified and your app is reviewed. This is normal.

The difference between App ID and Ad unit ID

These two things often confuse new developers:

  • App ID: the identity of the whole app. It looks like ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY, meaning there is a ~ sign in the middle. On Android it goes inside AndroidManifest.xml.
  • Ad unit ID: a separate identity for each ad placement. It looks like ca-app-pub-XXXXXXXXXXXXXXXX/ZZZZZZZZZZ, meaning there is a / sign in the middle. It goes in your code at the spot where the ad is loaded.

An app has one App ID, but it can have many ad units: for example, one for the banner on the home screen and a separate one for the interstitial shown when a level ends.

To add an app to AdMob, go to Apps → Add app. If the app is already live on the Play Store, search for it and link it; otherwise you can link it to the store later. Then, inside that app, create a new placement from Ad units → Add ad unit.

Types of ads (Ad formats)

  • Banner: a strip at the top or bottom of the screen. It is easy, but do not place it right next to buttons, so that people do not click it by mistake.
  • Interstitial: a full-screen ad that appears at a natural break, such as when a level ends. Showing it again and again, or as soon as the app opens, annoys users and can also go against policy.
  • Rewarded: the user chooses to watch an ad and gets a reward in return, such as an extra life or unlocking a feature. Tell the user clearly what the reward is, and never force it on them.
  • App open: an ad shown during loading when the user opens the app or comes back to it. Keep it within reasonable limits.
  • Native: an ad that matches the design of your app, such as a card in a feed. It must carry a clear "Ad" label so that users are not misled.

Test ads during development

This is AdMob's most important rule: never click on your own real (live) ads, and never ask friends or family to do it either. Google treats this as invalid traffic, and your account can be limited or closed.

There are two safe ways to test:

  1. Google's test Ad unit IDs: AdMob's developer documentation provides test IDs for every format. Use these during development. Ads served on them show the words "Test Ad".
  2. Test devices: add your phone in AdMob under Settings → Test devices, or set the device ID in your code. That way your phone will receive test ads even on your real ad units.

Before release, make sure you have removed the test IDs and put in your real IDs, and that you are not clicking ads yourself on the build that uses real IDs.

What is app-ads.txt and why does it matter?

app-ads.txt is a simple text file that states who has the right to sell ads in your app. It exists to stop fraud. AdMob now asks new apps to verify themselves with this file.

How to do it:

  1. In AdMob, go to Apps → View all apps, open the app-ads.txt section and copy the line given there.
  2. Create a file named app-ads.txt at the root of your website, for example https://yourdomain.com/app-ads.txt, and paste this line into it.
  3. In Play Console, enter that same website in the Contact details of your app's store listing, because AdMob looks for the file on that domain.
  4. AdMob may take some time to crawl the file, usually up to a day; after that, check the status.

Policies to remember no matter what

  • Invalid traffic: clicking your own ads, asking anyone to click them, or messages like "click on an ad to support us" are prohibited.
  • Placement: ads must not sit where they get clicked by accident, such as right next to a button, and must not cover your content.
  • Unexpected ads: a full-screen ad should not suddenly appear while the user is in the middle of doing something.
  • Content policy: apps containing copyrighted material, adult content or misleading claims are not allowed to show ads.
  • Children's apps: if your app is meant for children, you must follow Play Console's Families policy and the related AdMob settings.

If AdMob sends you a policy violation, check the Policy center to see what the problem is, fix it, and then request a review.

How do payments work?

Your AdMob earnings are collected in your AdSense payments profile. Before you get paid, these steps usually happen:

  1. When you reach a set amount, a PIN may be sent to you by post to verify your address, and you have to enter it in your account.
  2. You may need to verify your identity and fill in tax information.
  3. Add a payment method in the Payments section. In Pakistan, a wire transfer to a bank account is commonly used. The account holder's name should match the name on the payments profile.

Payment thresholds, dates and available methods can change over time, so be sure to confirm these details in the AdSense and AdMob Help Centers.

Common mistakes new developers make

  1. Leaving test IDs in the release build, or loading ads over and over on real IDs during development.
  2. Mixing up the App ID and the Ad unit ID, which can make the app crash or stop ads from showing.
  3. Putting far too many ads on a single screen.
  4. Not mentioning ad-related data in Play Console's Data safety form. The details are in our Google Play Console guide.
  5. Not setting up a consent message for users in regions such as Europe. The Privacy & messaging section in AdMob helps with this.
  6. Believing claims like "install this app and earn thousands every day". To avoid such schemes, read Staying safe from AI and online fraud.

If you do not have an app yet, you can start with our guide to building an app with AI without coding.

Summary

  • Create an AdMob account and link it to your single AdSense payments profile.
  • The App ID (the one with ~) is for the whole app, and the Ad unit ID (the one with /) is for each ad placement.
  • Use only test ads during development, and never click your own real ads.
  • Put app-ads.txt on your website and enter that same website in Play Console.
  • Place ads at natural points, do not annoy users, and keep checking the latest policies in the AdMob Help Center.

Note: AI tools and YouTube and Google policies change over time. Always check the official help page of the service before making any decision. Facts last checked against official help pages: . Disclaimer