In this guide, we’ll show you how to create AdMob ad units step-by-step so you can begin monetizing your mobile app with Google AdMob. Whether you’re building an Android or iOS app, ad units are the critical building blocks that enable you to display ads and earn revenue. Understanding how to properly create and implement them is key to a successful monetization strategy.
AdMob offers several ad formats—such as banner ads, interstitials, rewarded videos, and native ads—all of which require a unique ad unit ID to work. This blog post will walk you through the process of making ad units in AdMob, creating ad unit IDs, and best practices for setup and implementation.
What Is an Ad Unit in AdMob?
An ad unit in AdMob is a container that specifies where and how ads appear in your app. Each ad unit has its own ad unit ID, which you’ll use in your app code to fetch and display ads.
There are several types of ad units available:
-
Banner Ads – Small rectangular ads that sit at the top or bottom of the screen.
-
Interstitial Ads – Full-screen ads that appear at natural app transition points.
-
Rewarded Ads – Ads that users watch voluntarily in exchange for in-app rewards.
-
Native Ads – Customizable ads that match the look and feel of your app.
Each format serves a different purpose and user experience. Depending on your app’s design and engagement goals, you may use one or more ad unit types.
Prerequisites Before Creating Admob Ad Units
Before learning how to create AdMob ad units, make sure the following steps are completed:
-
AdMob Account – You need an active Google AdMob account. If you don’t have one, follow this guide to create one.
-
Added Your App to AdMob – Your app should be added to your AdMob dashboard, whether it’s published or not.
-
Integrated the Google Mobile Ads SDK – The Mobile Ads SDK must be added to your app’s codebase before the ad unit ID will work properly.
Now that you have the basics ready, let’s go ahead and create your ad units.
How to Make Admob Ad Units
This section will explain how to make ad unit in AdMob using the official AdMob platform.
Step 1: Log In to Your AdMob Account
-
Visit https://admob.google.com
-
Log in using your Google account credentials.
Step 2: Select or Add Your App
-
In the left-hand sidebar, click on “Apps”.
-
Select the app you want to monetize. If it hasn’t been added yet, click “Add App” and follow the prompts to enter your app name and platform (Android or iOS).
Step 3: Create an Ad Unit
-
Once inside your app’s dashboard, click on “Ad Units” in the left-hand menu.
-
Click the “Add Ad Unit” button.
-
Choose your preferred ad format:
-
Banner
-
Interstitial
-
Rewarded
-
Native
-
-
Configure your ad unit:
-
Enter a name (for your reference only)
-
Set advanced options like refresh rate (for banner ads)
-
Choose whether to enable video (for interstitials and rewarded ads)
-
-
Click “Create Ad Unit”.
Once completed, AdMob will generate a unique ad unit ID for this ad format. This ID is what you’ll copy and paste into your app code to request and display ads.
How to Create AdMob Ad Unit ID
After you’ve created an ad unit, the next step is understanding how to create AdMob ad unit ID and how to use it in your app.
What Is an Ad Unit ID?
An Ad Unit ID is a string of characters (something like ca-app-pub-1234567890123456/1234567890
) that uniquely identifies a specific ad unit you’ve created in AdMob. This ID is what your app uses to fetch the correct type of ad from Google’s servers.
How to Use Ad Unit IDs in Your App
Once you’ve created your ad unit and obtained the ad unit ID, follow these steps to implement it into your app code.
For Android (Java/Kotlin):
-
Make sure you’ve integrated the Google Mobile Ads SDK in your app’s
build.gradle
: -
Initialize the SDK in your
MainActivity.java
orMainActivity.kt
: -
Load and display a banner ad using the Ad Unit ID:
Ensure the
adView
in your layout XML file references the correct Ad Unit ID:
For iOS (Swift):
-
Install the SDK via CocoaPods:
-
Import and initialize:
-
Load a banner ad using the ad unit ID:
Make sure you test with Google’s test ad unit IDs during development to avoid policy violations.
Best Practices for Creating and Managing Ad Units
Now that you know how to create and implement ad units, here are some tips to manage them effectively:
1. Use Descriptive Names
Name your ad units clearly based on where they appear in the app and their format. Example: HomeScreen_Banner_Android
. This makes management easier, especially for larger apps.
2. Avoid Duplicate IDs Across Platforms
If you have both an iOS and Android version of your app, create separate ad units for each. Sharing one ad unit ID across platforms can lead to inaccurate reporting or compliance issues.
3. Use Test Ads During Development
Never use real ad unit IDs during development or testing. Google provides sample test IDs to ensure your implementation works without risking invalid traffic.
4. Monitor Performance Regularly
After launching your app, use AdMob’s built-in analytics to monitor performance:
-
Which ad formats are performing best
-
Which placements have the highest click-through rates
-
Earnings breakdown by app and ad unit
Troubleshooting Common Issues
Ads Not Showing?
-
Ensure you’ve added the correct ad unit ID.
-
Double-check SDK initialization.
-
Verify that you haven’t used real ad unit IDs before app approval.
-
Make sure your app is live or under review in AdMob.
Ad Unit ID Mistyped?
-
Go back to your AdMob dashboard under “Ad Units.”
-
Copy the exact ID and paste it into your code.
-
A single typo can prevent ads from displaying.
Received a Policy Warning?
-
Review AdMob’s program policies.
-
Never encourage users to click ads or place them in deceptive locations.
-
Avoid accidental clicks by placing ads away from navigational buttons.