How to Integrate Google AdMob in Your Android App

person WebInto.app Team calendar_today July 20, 2026
How to Integrate Google AdMob in Your Android App image

Advertising can fund an app that users are not ready to buy, but a rushed integration can damage the experience or trigger invalid-traffic enforcement. The ad unit is the easy part. Placement, consent, testing, and policy compliance determine whether monetization is sustainable.

This guide shows how to integrate Google AdMob in Android app projects, including website-based apps. You will create the AdMob records, connect the Google Mobile Ads SDK, select appropriate formats, request consent before eligible ad calls, use test ads during development, and release with useful monitoring.

AdMob does not guarantee income. Revenue depends on eligible traffic, geography, advertiser demand, format, viewability, user behavior, and policy status. Build around user value first, then evaluate ads with real data.

Plan Your AdMob Integration Before Adding Code

Start with the product experience. Decide where an ad can appear without blocking the task that brought the user into the app.

Choose an honest monetization model

AdMob supports several common formats:

  • Banner ads occupy a defined area and can remain visible while content is used.
  • Interstitial ads cover the screen at a natural transition.
  • Rewarded ads offer an explicit in-app benefit after the user chooses to watch.
  • Rewarded interstitial ads combine a reward with an interstitial-style flow and require clear advance disclosure.
  • Native ads provide assets that your app lays out in a policy-compliant ad container.
  • App open ads appear around loading or foreground transitions when implemented carefully.

Website-based apps often begin with an adaptive banner or a limited interstitial at a genuine page transition. A full-screen ad before login, during checkout, or after every tap will frustrate users and may create accidental clicks.

Rewarded ads only make sense when the app can grant a real, clearly described reward. A news site might unlock an optional article pack. A course app might grant access to one supplemental quiz. Do not promise a reward the website or backend cannot reliably record.

Map each placement's format, trigger, minimum interval, excluded screens, and no-ad fallback. Keep ads away from navigation controls and interactive website elements. Reserve banner space so content does not jump, and show interstitials only at natural breaks.

Check eligibility and disclosures

Create a public privacy policy that names advertising and relevant data processing. In Google Play Console, declare that the app contains ads and keep Data safety answers aligned with the SDK, consent configuration, and any mediation partners.

Apps directed to children or mixed audiences have additional Families policy obligations. Regulated content, deceptive interfaces, and copied low-value content can also create approval or serving problems. Read the current AdMob policies before implementation, not after an enforcement email.

Once placements and disclosures are defined, you can create matching AdMob resources without guessing.

Create the AdMob App and Ad Units

AdMob distinguishes the app record, App ID, and ad unit IDs. Mixing them is a common source of missing ads.

Add the app in AdMob

Sign in to AdMob with an account your business controls. Add the Android app. If it is already listed on Google Play, link the store listing. If it is not published, add it as an unpublished app and complete store linking later.

The AdMob App ID identifies the app to the Google Mobile Ads SDK. It looks similar to ca-app-pub-1234567890123456~1234567890. It belongs in the Android app's metadata or the configuration field provided by your app builder.

An ad unit ID identifies one placement and format. It looks similar but uses a slash, such as ca-app-pub-1234567890123456/9876543210. Do not put an ad unit ID where the App ID is expected.

Create one ad unit per placement

Create descriptive ad unit names such as:

  • home_bottom_adaptive_banner
  • article_exit_interstitial
  • bonus_lesson_rewarded

Separate units make reports useful and let you disable a problematic placement without disturbing the rest of the app. Do not reuse one banner unit for every unrelated screen merely to save setup time.

Record each production ID in a controlled configuration document. Developers need placement IDs, but account permissions and payment details should remain limited to authorized staff.

Prepare the website-app shell

AdMob runs through the native Android SDK, not through an ad script pasted into a WebView. A website's existing web ads and a native AdMob placement are separate products with separate policy and layout considerations.

In WebInto.app, configure the AdMob App ID and supported placement IDs in the app's monetization settings. Changing native SDK configuration normally requires a fresh build. If you are starting from a URL, complete the website-to-app conversion guide before monetization.

With identifiers organized, the SDK can be initialized in a predictable order.

Integrate Google AdMob in Android App Builds

Native Android developers should follow Google's current Mobile Ads SDK quick start. App-builder users should use the builder's supported fields rather than injecting native code through website JavaScript.

Add the SDK and App ID

Add the current supported Google Mobile Ads SDK dependency through Gradle. Insert the AdMob App ID in the Android manifest exactly as Google's guide specifies. A missing or malformed App ID can cause initialization failure at app start.

Initialize the SDK once, preferably after completing any consent flow that determines whether ads can be requested. Avoid initializing ad objects repeatedly on every WebView navigation.

For a WebInto.app project, the generated shell handles SDK inclusion when the monetization feature is enabled. Save the correct identifiers, create a new build, and install that build on a test device.

Load a banner safely

Use an anchored adaptive banner so the requested size fits the current device width. Give the ad view dedicated space outside the WebView's interactive content. Load an ad request only after your consent logic says it is allowed.

Destroy or release ad views according to the SDK lifecycle when the containing screen is removed. Repeatedly creating banners without cleanup can waste resources and distort requests.

Load full-screen formats in advance

Interstitial and rewarded ads are loaded asynchronously. Preload at a sensible point, store the loaded object briefly, and show it only after the user reaches the planned transition. If no ad is ready, continue the app flow. Never block essential navigation waiting for an ad.

After a full-screen ad is shown, discard that instance and load another for a future transition. Handle dismissal and failure callbacks so the user always reaches the intended destination.

For rewarded ads, grant the benefit from the reward callback, not merely when the ad opens. For rewards with financial or entitlement value, validate server-side verification where supported and make the operation idempotent.

A native interstitial should not trigger on every WebView URL change. Sites redirect during login, checkout, and analytics flows, which can cause repeated ads. Use stable app events with frequency controls, then test back navigation, external links, rotation, and offline behavior.

The code path is not ready for production until test ads and consent have been verified.

Use Test Ads and Prevent Invalid Traffic

Google explicitly requires safe testing practices. Clicking live ads from your own app can be treated as invalid activity.

Use Google's demo units first

During development, use Google's format-specific demo ad unit IDs from the official test ads guide. They are not connected to your account, so impressions and clicks do not affect production reports or advertisers.

Android emulators are automatically treated as test devices for Google ads. Physical phones must use demo units or be registered as test devices when you test with your own unit IDs. Confirm that Google-served creatives display a Test Ad label before interacting with them.

Do not leave test-device logic to memory. Use separate debug and release configuration so production IDs cannot appear in a debug build by accident, and demo IDs cannot ship in release.

Test every lifecycle state

For banners, test initial load, no fill, slow network, rotation, WebView scrolling, and navigation away. For interstitials, test load failure, backgrounding, dismissal, rapid repeated triggers, and app process recreation. For rewarded ads, test completion, early close, duplicate callbacks, and reward failure.

An unavailable ad should never prevent reading content, completing checkout, recovering a password, or leaving the app.

Protect the account after launch

Never ask users, staff, friends, or contractors to click ads to support the app. Do not place controls where accidental clicks are likely. Monitor invalid traffic notices and sudden changes in click-through rate by ad unit and country.

Limit AdMob account access, enable strong authentication, and investigate suspicious traffic before increasing spend or placements. A short-term earnings spike can signal a serious quality issue.

Safe testing protects the account. Consent and policy handling protect users and distribution.

Implement Consent and Policy Compliance

Consent is not a popup added after ad loading. It is part of deciding whether an ad request can be made and which signals may be used.

Configure privacy messages

Use AdMob's Privacy and messaging controls to configure the regions and disclosures relevant to your app. Google's User Messaging Platform, or UMP SDK, can request updated consent information and display a form when required.

Follow the current UMP Android guide. Call requestConsentInfoUpdate() on each app launch so requirements can be evaluated using current configuration. Then use loadAndShowConsentFormIfRequired() or the current supported flow.

Before requesting an ad, check canRequestAds(). Google notes that this returns false until the consent information update has been requested. If consent gathering returns an error, check whether a valid prior-session status allows requests rather than assuming either consent or denial.

Offer privacy options later

Some users must be able to revisit their choices. Check the UMP privacy-options requirement and expose a visible settings entry when required. Do not hide it behind an unrelated account deletion flow.

Use UMP debug geography and registered test-device hashes to test EEA-style and other configured experiences. Remove debug overrides before release.

Meet regional and store obligations

Google's EU User Consent Policy covers required disclosures and consent for eligible users in the EEA, United Kingdom, and Switzerland. Other jurisdictions may impose separate requirements. UMP helps implement configured messages, but it does not write your privacy policy or provide legal advice.

Your Play listing must declare ads. Data safety should account for the Mobile Ads SDK and mediation SDKs you actually ship. If the app targets children, review ad content, identifiers, SDK certification, and age-screen requirements under the Families policies.

Avoid policy-sensitive placement patterns

Do not style an ad as app navigation, put it immediately beside a small button, or make users click an ad to close a screen. Full-screen formats need appropriate transitions and disclosures. Native ads need required attribution and AdChoices elements.

Review policy again when adding a new format or mediation partner. Compliance is a continuing release task, not a one-time checkbox.

With consent and test behavior working, a small production rollout can reveal whether the placement is commercially worthwhile.

Launch, Measure, and Improve Ad Revenue

Move from test IDs to production IDs only in a signed release build. Verify the package name, App ID, ad units, consent flow, and privacy policy before rollout.

A realistic rollout example

Leena publishes a free recipe app built from her responsive website. Readers typically spend four minutes following one recipe. She considers an interstitial on every page but rejects it because ingredient and instruction pages generate many internal navigations.

Instead, she places one anchored adaptive banner below the native app bar, outside recipe controls. She excludes login, subscription, and checkout pages. An interstitial is eligible only after a user closes a saved recipe, no more than once in a defined session interval.

Leena tests with Google's demo IDs on two physical devices and an emulator. She simulates consent regions with UMP debug settings, confirms the privacy-options entry, and checks that no-fill responses leave the layout usable. She then releases to 10 percent of users.

For two weeks she watches estimated earnings, match rate, impressions per session, retention, crashes, and reviews. The banner earns modestly without changing completion. The interstitial correlates with shorter sessions, so she reduces its frequency. This is a successful test because the decision follows product and revenue data, not because every placement remained enabled.

Read reports carefully

Estimated earnings are not final payments. Compare ad units by format, country, and app version. Match rate, show rate, impression RPM, and click-through rate describe different stages. A low show rate may be an implementation issue; a sudden high click rate may indicate accidental or invalid interaction.

Ad revenue per active user is more useful when paired with retention and conversion. If ads reduce subscriptions, purchases, or long-term usage, the apparent gain may be negative.

Change placement, frequency, or format separately so results remain interpretable. Stop immediately if a placement blocks content or attracts accidental taps. Do not promise a specific RPM because ad markets and serving eligibility vary.

Conclusion: Integrate AdMob With User Trust Intact

To integrate Google AdMob in Android app projects safely, define appropriate placements, create separate ad units, initialize the native SDK correctly, and keep essential app flows independent from ad availability. Use demo ads or registered test devices for every development click.

Before production requests, implement UMP consent checks, a privacy-options path, honest Play disclosures, and format-specific policy review. Then release gradually and judge revenue beside retention, reviews, and invalid-traffic signals. If your app begins as a website, WebInto.app can provide the Android shell; add monetization only after the core experience is stable.

FAQ

Is Google AdMob free to integrate?

Creating an AdMob account and adding the SDK does not require an integration fee. Google shares eligible advertising revenue according to its platform terms. Development, consent management, mediation, and policy compliance still require time and may involve other costs.

Can I put AdMob code directly in my website?

AdMob is for native mobile app inventory through the Google Mobile Ads SDK. Website advertising uses web products and policies. In a WebView app, configure native AdMob support in the Android shell rather than pasting a native ad unit into website JavaScript.

Why must I use test ads?

Test ads let developers load and click creatives without charging advertisers or generating invalid activity. Use Google's demo IDs or register physical devices as test devices. Never click a live ad in your own production app.

Do I need consent before loading AdMob ads?

Requirements depend on the user, region, app configuration, and applicable policies. Use UMP to update consent information and display required forms, then check canRequestAds() before ad requests. Also provide privacy options when the SDK indicates they are required.

Which AdMob format is best for a website-based app?

There is no universal best format. An anchored adaptive banner is often a manageable first test because placement is predictable. Interstitial and rewarded formats can work at genuine transitions, but they need stricter frequency, lifecycle, and reward handling.

WebInto.app app icon

Ready to start?

Convert your website into an Android app

Install WebInto.app and build your APK in minutes. No coding required.

Get it on Google Play