How to Add AdMob Ads to a WebView App (Step by Step, 2026)

How to Add AdMob Ads to a WebView App (Step by Step, 2026)

WebView apps are one of the fastest ways to ship a mobile app — wrap your existing website in a native container and you're done. But getting paid is a different story. AdMob is the right monetization tool for this, and the setup is simpler than most tutorials suggest. This guide covers every step: from creating your AdMob account through displaying live ads, plus the policy traps that get accounts banned.

What Is AdMob and Why Use It in a WebView App?

AdMob is Google's mobile ad platform, and it's the standard way to monetize a WebView app. It serves ads from Google's demand pool — the same advertisers that run Google Search and Display campaigns — so fill rates are high and eCPMs are competitive from day one.

WebView apps are a good fit for AdMob for one specific reason: the ads sit in the native layer, outside the WebView itself. That means you get mobile ad rates (which outperform desktop web rates) without any changes to your website's HTML. Your website stays exactly as it is. The SDK adds revenue on top of it.

AdMob supports four main ad formats:

  • Banner — a small strip at the top or bottom of the screen, always visible.
  • Interstitial — a full-screen ad shown at natural transition points, like after a user completes an action.
  • Rewarded — a full-screen video the user opts into in exchange for a reward.
  • Native — an ad styled to match your app's UI. Rarely used in WebView apps.

You can run multiple formats in the same app. Most WebView apps start with a banner (always on) and add interstitials at page-load transitions. Ads are only one revenue channel — see our full guide to mobile app monetization strategies for subscriptions, in-app purchases, and affiliate models.

What Changed in 2025–2026 (AdMob + WebView Updates)

Three changes between 2025 and 2026 directly affect WebView apps using AdMob. If you're following a tutorial from 2023 or earlier, some of it is outdated.

Google Play's WebView Policy (Enforced 2024–2025)

Google tightened enforcement of its policy against apps that do nothing but wrap a website. Apps without meaningful native functionality — push notifications, offline mode, custom navigation, or similar — are now rejected during review. This affects AdMob indirectly: a rejected app can't show ads. If you're building a thin WebView wrapper, add at least one native feature before publishing. We break down the exact requirements in what makes a WebView app good enough for the app stores, and the Apple equivalent in Apple Guideline 4.2 for WebView apps.

Google Mobile Ads SDK v23+

The Mobile Ads SDK reached version 23 in late 2024. The API for loading interstitials changed: InterstitialAd.load() now uses a callback-based pattern instead of the old listener approach. If you're copying code from pre-2024 tutorials, the interstitial loading section will produce compile errors. The step-by-step section below uses the current v23 API.

ATT Prompt Requirement on iOS (Stricter Review)

Apple has enforced the App Tracking Transparency (ATT) prompt more strictly since iOS 17. Any AdMob-enabled iOS app that doesn't show the ATT prompt before initializing the SDK risks App Store rejection. The Google Mobile Ads SDK now ships with a User Messaging Platform (UMP) SDK for consent handling — you must integrate it, not skip it.

Adaptive Banners Replace Smart Banners

Smart banners are deprecated. Adaptive banners auto-size to the device's width and content density, produce higher eCPMs, and are now the default recommendation. Any tutorial still using AdSize.SMART_BANNER is using a deprecated API — switch to AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(context, width).

Prerequisites Before You Start

You need four things before writing a single line of code.

  1. A working WebView app. Android Studio project with a WebView in your layout, or Xcode project with a WKWebView. If you haven't built one yet, start with converting your website to an Android app using WebView + Android Studio. The app should load your site and run without crashes.
  2. An AdMob account. Free to create at admob.google.com. You need a Google account. Payment activation (address verification, tax forms) can happen after you've confirmed the integration works.
  3. A privacy policy. AdMob requires one. It must disclose that your app shows interest-based advertising and uses device advertising identifiers. Host it on a URL you control and link to it from the Play Store listing and from within the app. You'll also declare AdMob's data collection in Google Play's Data Safety form — advertising IDs must be disclosed there.
  4. Minimum SDK versions. Android: minSdkVersion 21 or higher. iOS: iOS 13 or higher. The current Google Mobile Ads SDK drops support for older OS versions — check the release notes if you need to support anything older.

Step-by-Step: Adding AdMob to an Android WebView App

The full integration takes 7 steps and roughly 30 minutes for a developer who has done it before. For a first-timer, plan for an hour — the account setup side is mostly waiting for pages to load.

1

Create an AdMob account and register your app

Go to admob.google.com → sign in → click Add App. Choose Android. Enter your app's name (it doesn't need to match the Play Store name yet). AdMob generates an App ID in the format ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX. Copy it — you need it in Step 4.

2

Create an Ad Unit and get its ID

Inside your AdMob app dashboard, go to Ad Units → Add Ad Unit. Choose your format. Name the unit descriptively (e.g., "Main Banner" or "Post-Load Interstitial"). AdMob provides an Ad Unit ID in the format ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX. The App ID and Ad Unit ID are different — you need both.

3

Add the Mobile Ads SDK to build.gradle

In your app-level build.gradle, add the dependency inside dependencies { }:

implementation 'com.google.android.gms:play-services-ads:23.6.0'

Replace 23.6.0 with the latest version from the AdMob Android release notes. Click Sync Now in Android Studio after saving.

4

Add your App ID to AndroidManifest.xml

Inside the <application> tag, add this metadata entry with your real App ID:

<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX"/>

If you skip this step, your app will crash at runtime with the message: "The Google Mobile Ads SDK was initialized incorrectly." It's the most common first-time mistake.

5

Initialize the SDK in your Application class

In your Application subclass (or MainActivity.onCreate() if you don't have one), add the initialization call:

// Java
MobileAds.initialize(this, initializationStatus -> {
    // SDK ready — load ads after this callback fires
});

// Kotlin
MobileAds.initialize(this) { initializationStatus ->
    // SDK ready
}

The SDK initializes asynchronously. Load your first ad inside this callback, not before it.

6

Add a banner ad to your layout

In your activity_main.xml, add an AdView positioned above or below the WebView — never overlapping it:

<com.google.android.gms.ads.AdView
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:id="@+id/adView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX"/>

Then in your Activity, load an ad after SDK initialization:

// Kotlin
val adView: AdView = findViewById(R.id.adView)
val adRequest = AdRequest.Builder().build()
adView.loadAd(adRequest)
7

Test with test ad IDs before going live

Use Google's official test Ad Unit IDs during development. Clicking your own real ads or loading them without user traffic violates AdMob policy and can get your account terminated. Switch to your real Ad Unit ID only immediately before submitting to the Play Store.

FormatTest Ad Unit ID
Bannerca-app-pub-3940256099942544/6300978111
Interstitialca-app-pub-3940256099942544/1033173712
Rewardedca-app-pub-3940256099942544/5224354917

Adding Interstitials (v23 API)

Interstitials changed in SDK v23. The static load() method replaced the old listener pattern. Show them at natural break points — when the user navigates to a new page in your WebView is a common trigger.

// Kotlin — load an interstitial
InterstitialAd.load(
    this,
    "ca-app-pub-3940256099942544/1033173712", // test ID
    AdRequest.Builder().build(),
    object : InterstitialAdLoadCallback() {
        override fun onAdLoaded(ad: InterstitialAd) {
            interstitialAd = ad
        }
        override fun onAdFailedToLoad(error: LoadAdError) {
            interstitialAd = null
        }
    }
)

// Show when the user navigates
webView.webViewClient = object : WebViewClient() {
    override fun onPageFinished(view: WebView, url: String) {
        interstitialAd?.show(this@MainActivity)
    }
}

Tip: Don't show an interstitial on every page load. Google's policy requires ads to appear at natural transitions. Show one every 3–5 page loads at most, and always let the user complete their intended action first.

AdMob in iOS WebView Apps

The iOS setup follows the same pattern as Android — SDK in the native layer, ads alongside the WKWebView. The main differences are the integration method (Swift Package Manager or CocoaPods) and the mandatory ATT prompt.

Add the SDK via Swift Package Manager

In Xcode, go to File → Add Package Dependencies. Enter the URL: https://github.com/googleads/swift-package-manager-google-mobile-ads. Select the latest version and add it to your target.

Add your App ID to Info.plist

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX</string>

Initialize in AppDelegate

import GoogleMobileAds

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        MobileAds.shared.start(completionHandler: nil)
        return true
    }
}

Show the ATT Prompt

Before initializing the SDK, request tracking permission using Apple's AppTrackingTransparency framework. Users who grant permission generate higher eCPMs because personalized ads can be shown. Users who deny still see ads — just non-personalized ones.

import AppTrackingTransparency

ATTrackingManager.requestTrackingAuthorization { status in
    // Initialize AdMob after the user responds
    MobileAds.shared.start(completionHandler: nil)
}

Add a GADBannerView

Add a GADBannerView as a subview positioned above or below your WKWebView. Set its adUnitID, its rootViewController, and call load(GADRequest()). The layout is identical in principle to the Android implementation — two views stacked, the WebView taking most of the screen, the ad view pinned to the bottom.

Ad Format Comparison for WebView Apps

Not all ad formats earn equally, and not all suit every app. Here's a practical breakdown.

AdMob ad format comparison: eCPM and user experience Format Relative eCPM User Impact Fit for WebView Rewarded ●●●●● (Highest) Low — user opts in ✓ Excellent Interstitial ●●●● (High) Medium — full screen ✓ Good Adaptive Banner ●● (Low–Medium) Low — always visible ✓ Baseline Native ●●● (Medium) Low — blends in ~ Complex setup

For most WebView apps, the practical starting point is: adaptive banner always on + interstitial at page transitions. Add rewarded ads once you have enough user engagement to design a meaningful reward mechanic. Ad revenue scales with installs, so pair this with a plan for getting your first 1,000 app downloads.

Using AdMob with WebView Builder Tools

If you're using a no-code builder to generate your WebView app, AdMob support is built in — you don't need to touch the SDK yourself.

Tools like AppOfWeb generate a native Android and iOS WebView app from your website URL and handle AdMob integration as part of the build. You enter your AdMob App ID and Ad Unit IDs in the builder's settings panel. The generated app includes the SDK, the manifest entries, and the ad view layouts — all pre-wired.

This approach is faster than manual integration, but you still need to:

  • Create your AdMob account and get your IDs — the builder can't do that for you.
  • Create separate ad units for each format you want (banner, interstitial, rewarded) — each format requires its own Ad Unit ID.
  • Test with test IDs first, then replace with real IDs before the final build.
  • Ensure the app complies with Play Store policies — specifically the native functionality requirement.

Builder tools that include push notifications, offline caching, and custom navigation satisfy Google Play's WebView policy requirements. Apps that wrap a URL with nothing else do not — regardless of how they're built.

Common Mistakes Developers Make with AdMob + WebView

❌ Injecting AdSense code into the WebView's HTML

Putting AdSense JavaScript into the website your WebView loads is against both AdSense and AdMob policy. Google's systems detect the disguised traffic origin. The result is account termination, not a warning. Use AdMob in the native layer only.

❌ Clicking your own test ads

AdMob monitors click patterns. Clicking your own ads — even during testing — is invalid click activity. If you want to verify ads load, observe them visually. Don't tap them. Use test Ad Unit IDs during development, which are designed to be safe to interact with.

❌ Forgetting the APPLICATION_ID in AndroidManifest.xml

This causes a hard crash when the app starts. It's the most searched AdMob error message for a reason. The App ID and Ad Unit ID are different strings — you need the App ID in the manifest and the Ad Unit ID in your layout or code.

❌ Showing interstitials on every page load

Google's policies require interstitial ads to appear at natural transition points and not to interrupt the user mid-task. Showing one every time the WebView finishes loading a page will get your app flagged. Throttle interstitials to one per several page loads, and only at transitions the user initiated.

❌ Skipping the ATT prompt on iOS

Since iOS 14.5, apps that use advertising identifiers must show the ATT prompt. The Google Mobile Ads SDK uses the IDFA if permission is granted. Shipping an iOS AdMob app without ATT integration leads to App Store rejection — reviewers check this.

❌ Using Smart Banners instead of Adaptive Banners

AdSize.SMART_BANNER is deprecated and will eventually be removed. It also underperforms adaptive banners in eCPM. Switch to AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(). It takes one extra line of code and pays more.

❌ Shipping a thin WebView app with no native features

Google Play reviewers reject apps that are bare website wrappers. This isn't an AdMob rule — it's a Play Store rule — but it prevents your app from going live at all. Add at least one native feature: push notifications, offline support, custom navigation, or a splash screen with caching. This also gives users a reason to install instead of just bookmarking the site. See the 10 most common Google Play rejection reasons for the full list.

FAQs

Can I show AdMob ads inside the WebView itself?

No, and you should not try. AdMob ads must live in native Android or iOS views, not inside the WebView's HTML content. Injecting ad code into your website's HTML inside the WebView violates both Google AdMob policies and Google AdSense policies simultaneously — it can get both accounts terminated. The correct approach is to display AdMob native ad units (banners, interstitials, rewarded) in the native layer surrounding the WebView.

Will AdMob ads show if my WebView app gets rejected by Google Play?

AdMob itself does not cause rejections, but a thin WebView app with no original functionality beyond wrapping a website often does. Google Play's WebView policy (updated in 2024) requires apps to provide functionality beyond a browser shortcut. If your app is rejected, the fix is to add native features — offline caching, push notifications, custom navigation — not to remove ads. Fix the app, then monetize it.

How long does AdMob account approval take in 2026?

Initial AdMob account creation is instant. However, full payment activation — where AdMob actually pays out your earnings — requires a verification step that typically takes 24–48 hours for email verification and up to 2 weeks for address/identity verification via a PIN mailed to your address. You can integrate and test ads immediately; payment eligibility is a separate process.

What ad format makes the most money in a WebView app?

Rewarded ads consistently produce the highest eCPM in WebView apps, often 5–15x the eCPM of a banner ad. The trade-off is user opt-in — you must offer a meaningful reward (unlocking content, removing a timer, granting a bonus) to drive watch rates. Interstitials are the second-highest earner and require no reward mechanic, but must be shown at natural break points. Banners are lowest earning but always visible — good as a baseline alongside another format.

Do I need a privacy policy to use AdMob?

Yes, and it must meet two requirements simultaneously. Google AdMob requires a privacy policy disclosing that your app shows interest-based ads and uses device advertising IDs. The Google Play Store also requires a privacy policy for any app that collects or shares personal data, which AdMob triggers automatically. Your policy must be linked from both the Play Store listing and from within the app itself. Failing either requirement is grounds for account termination or app removal.

Can I use AdMob in an iOS WebView app?

Yes. The setup mirrors Android: add the Google Mobile Ads SDK via Swift Package Manager or CocoaPods, add your AdMob App ID to Info.plist, initialize the SDK in AppDelegate, then add ad views (GADBannerView, GADInterstitialAd, or GADRewardedAd) as native UI elements alongside your WKWebView. The same policy rules apply — ads must sit in the native layer, not injected into the web content loaded by WKWebView.

What is the difference between AdMob and AdSense for a WebView app?

AdSense is for websites and shows ads inside HTML content running in a browser. AdMob is for mobile apps and shows ads in native mobile UI. A WebView app runs a website inside a native container — the AdMob SDK goes in the native container, not in the website HTML. Using AdSense inside a WebView app (injecting AdSense code into the site the WebView loads) violates AdSense's invalid traffic policies because the traffic origin is disguised. Use AdMob in the native layer exclusively.

Key Takeaways

  • AdMob ads go in the native layer — never inside the WebView's HTML.
  • The App ID (manifest) and Ad Unit ID (ad view) are different strings. You need both.
  • Use Google's test Ad Unit IDs during development. Switch to real IDs only before your final build.
  • Smart Banners are deprecated — use Adaptive Banners for better eCPM.
  • Interstitials use the v23 callback-based API — old tutorials showing the listener pattern will produce compile errors.
  • iOS apps must show the ATT prompt before SDK initialization or face App Store rejection.
  • Your app needs native functionality beyond wrapping a URL — Google Play enforces this and it affects your ability to publish at all.
  • Rewarded ads earn the most. Start with banner + interstitial, then add rewarded once you have engagement.

Skip the SDK Setup Entirely

AppOfWeb generates a native Android and iOS WebView app from your website — with AdMob integration, push notifications, offline caching, and Play Store submission built in. Enter your AdMob IDs and we wire them up.

Build Your App →