광고 수익 창출을 위한 WebView API 통합
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
광고 수익 창출을 위한 WebView API를 이용하면 WebViewController
를 통해 인앱 광고 수익을 올리게 됩니다.
WebViewController
를 통해 앱에서 애드센스 코드 또는 Google 게시자 태그를 이용해 광고를 구현하는 웹 콘텐츠를 표시하는 경우 광고 수익을 올리려면 이 API를 사용하세요. 자세한 내용은 AdMob 정책을 참고하세요.

- Google 모바일 광고 SDK로 광고를 요청하여 수익 창출
모바일 앱용 광고 형식을 구현하여 Google 모바일 광고 SDK로 AdMob에 광고를 요청하면 앱에서 수익을 창출할 수 있습니다.
자세히 알아보기
- 광고 수익 창출을 위한 WebView API를 사용하여 수익 창출
앱에서 WebViewController
를 이용해 Ad Manager 또는 AdSense의 광고를 게재하는 웹 콘텐츠를 표시하는 경우에는 광고 수익 창출을 위한 WebView API를 Google 모바일 광고 SDK와 함께 이용해 WebViewController
객체를 등록하세요. 애드센스 코드 또는 Google 게시자 태그의 JavaScript가 광고 요청을 생성하고 전송하므로 SDK로 광고 요청을 하지 않아도 됩니다. 이 API를 사용하면 모바일 웹 및 데스크톱 웹 인벤토리 형식만 사용할 수 있습니다.
WebViewController
에서 웹 콘텐츠를 소유하지 않은 경우에도 이 API를 이용하면 광고주를 스팸으로부터 보호하고 콘텐츠를 제공한 웹 게시자의 수익 창출을 개선하는 데 도움이 됩니다.
동일한 앱에서 두 옵션 중 하나만 또는 둘 다 사용할 수 있습니다.
이 가이드에서는 광고 수익 창출을 위한 WebView API를 iOS 앱에 통합하는 방법을 설명합니다.
시작하기 전에
광고 수익 창출을 위한 WebView API를 사용하기 전에 다음을 실행해야 합니다.
애플리케이션 식별자 확인 우회
Android
다음 <meta-data>
태그를 AndroidManifest.xml
파일에 추가하면 APPLICATION_ID
검사를 건너뜁니다. 이 단계를 놓치면 앱 시작 시 Google 모바일 광고 SDK에서 IllegalStateException
을 발생시킬 수 있습니다.
<!-- Bypass APPLICATION_ID check for WebView API for Ads -->
<meta-data
android:name="com.google.android.gms.ads.INTEGRATION_MANAGER"
android:value="webview"/>
iOS
아래의 키 및 문자열 값으로 Runner/Info.plist
파일을 업데이트하면 GADApplicationIdentifier
검사를 건너뜁니다. 이 단계를 놓치면 앱 시작 시 Google 모바일 광고 SDK에서 GADInvalidInitializationException
을 발생시킬 수 있습니다.
<!-- Bypass GADApplicationIdentifier check for WebView API for Ads -->
<key>GADIntegrationManager</key>
<string>webview</string>
WebViewController 등록
애드센스 코드 또는 Google 게시자 태그를 사용하는 WebViewController
내에서 광고의 인앱 광고 수익 창출을 개선하려면 아래 단계를 따르세요.
WebViewController
에서 JavaScript를 사용 설정합니다. 이렇게 하지 않으면 광고가 로드되지 않을 수 있습니다.
사용자의 광고 경험을 개선하고 Chrome의 쿠키 정책을 준수하려면 AndroidWebViewController
인스턴스에서 서드 파티 쿠키를 사용 설정하세요.
Google 모바일 광고 SDK에서 제공하는 registerWebView()
메서드를 호출하여 WebViewController
인스턴스를 등록합니다.
import 'package:google_mobile_ads/google_mobile_ads.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter_android/webview_flutter_android.dart';
@override
class WebViewExampleState extends State<WebViewExample> {
late final WebViewController controller;
@override
void initState() {
super.initState();
createWebView();
}
void createWebView() async {
controller = WebViewController();
// 1. Enable JavaScript in the web view.
await controller.setJavaScriptMode(JavaScriptMode.unrestricted);
// 2. Enable third-party cookies for Android.
if (controller.platform is AndroidWebViewController) {
AndroidWebViewCookieManager cookieManager = AndroidWebViewCookieManager(
const PlatformWebViewCookieManagerCreationParams());
await cookieManager.setAcceptThirdPartyCookies(
controller.platform as AndroidWebViewController, true);
}
// 3. Register the web view.
await MobileAds.instance.registerWebView(controller);
}
}
URL 로드
이제 WebViewController
를 통해 URL을 로드하고 웹 콘텐츠를 표시할 수 있습니다.
자체 URL을 사용하기 전에 테스트 URL(https://google.github.io/webview-ads/test/
)을 로드하여 통합을 테스트하는 것이 좋습니다. JavaScript가 사용 설정되어 있지 않으면 웹페이지에 오류가 표시됩니다.
import 'package:google_mobile_ads/google_mobile_ads.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:webview_flutter_android/webview_flutter_android.dart';
@override
class WebViewExampleState extends State<WebViewExample> {
late final WebViewController controller;
@override
void initState() {
super.initState();
createWebView();
}
void createWebView() async {
controller = WebViewController();
// 1. Enable JavaScript in the web view.
await controller.setJavaScriptMode(JavaScriptMode.unrestricted);
// 2. Enable third-party cookies for Android.
if (controller.platform is AndroidWebViewController) {
AndroidWebViewCookieManager cookieManager = AndroidWebViewCookieManager(
const PlatformWebViewCookieManagerCreationParams());
await cookieManager.setAcceptThirdPartyCookies(
controller.platform as AndroidWebViewController, true);
}
// 3. Register the web view.
await MobileAds.instance.registerWebView(controller);
// 4. Load the URL.
await controller.loadRequest(Uri.parse('https://google.github.io/webview-ads/test/'));
}
다음 조건이 적용되는 경우 테스트 URL에 통합이 성공했음을 나타내는 녹색 상태 표시줄이 표시됩니다.
WebView
가 Google 모바일 광고 SDK에 연결됨
- JavaScript 사용 설정
- 서드 파티 쿠키가 작동함 (iOS 기기에서는 예상되지 않음)
- 퍼스트 파티 쿠키 작동 방식
테스트 URL의 소스 코드를 확인합니다. 이제 테스트 URL을 원하는 URL로 바꿀 수 있습니다. Charles와 같은 프록시 도구를 사용하여 앱의 HTTPS 트래픽을 확인하고 광고 요청에 &scar=
매개변수가 있는지 검사할 수도 있습니다.

달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-09-02(UTC)
[null,null,["최종 업데이트: 2025-09-02(UTC)"],[[["\u003cp\u003eThe WebView API for Ads enables in-app ad monetization when displaying web content with AdSense or Google Publisher Tag ads through \u003ccode\u003eWebViewController\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo use this API, register your \u003ccode\u003eWebViewController\u003c/code\u003e objects with the Google Mobile Ads SDK, ensuring JavaScript and third-party cookies (for Android) are enabled.\u003c/p\u003e\n"],["\u003cp\u003eThis API simplifies ad serving by handling ad requests within the web content's JavaScript, eliminating the need for manual ad requests from your app.\u003c/p\u003e\n"],["\u003cp\u003eIt is recommended to use this API even for third-party web content to enhance ad monetization and protect against spam.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting, ensure you're using the Google Mobile Ads SDK for Flutter plugin (v3.0.0+), \u003ccode\u003ewebview_flutter\u003c/code\u003e, and \u003ccode\u003ewebview_flutter_android\u003c/code\u003e (v3.7.0+) in your app.\u003c/p\u003e\n"]]],["The WebView API for Ads facilitates in-app ad monetization through `WebViewController`. To use this, register `WebViewController` objects with the Google Mobile Ads SDK. Enable JavaScript and third-party cookies in the `WebViewController` and then call `registerWebView()`. For Android, add a specific `\u003cmeta-data\u003e` tag in `AndroidManifest.xml`, and for iOS, update `Info.plist` to bypass checks. You can load web content that implements ads from AdSense or Google Publisher Tag via this API and use a test URL to verify integration.\n"],null,["The WebView API for Ads allows in-app ad monetization using\n[`WebViewController`](//pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewController-class.html).\nIf you display web content that implements ads with\n[AdSense code](//support.google.com/adsense/answer/9274634) or\n[Google Publisher Tag](//support.google.com/admanager/answer/181073)\nin your app through `WebViewController`, you should use this API to enable ads\nmonetization. To learn more, see the\n\n[AdMob policies](//support.google.com/admob/answer/48182#trs).\n\n\n1.\n\n Monetize by making ad requests with Google Mobile Ads SDK\n\n : You can monetize your app by making ad requests to\n\n AdMob with\n Google Mobile Ads SDK by implementing [ad formats for mobile\n app](//support.google.com/admob/answer/6128738).\n\n\n [Learn more](/admob/flutter/quick-start).\n2.\n\n Monetize by using the WebView API for Ads\n\n : If your app uses `WebViewController` to display web content that serves ads from\n [Ad Manager](//support.google.com/admanager) or\n [AdSense](//support.google.com/adsense), use the WebView API for Ads to register\n `WebViewController` objects with Google Mobile Ads SDK. The\n JavaScript in the [AdSense code](//support.google.com/adsense/answer/9274634)\n or [Google Publisher Tag](//support.google.com/admanager/answer/181073)\n builds and sends ad requests so you don't need to make any ad requests with\n the SDK. Keep in mind that only the mobile web and desktop web\n [inventory formats](//support.google.com/admanager/answer/9796545)\n are available using this API.\n\n If you don't own the web content in a `WebViewController`, you are still\n encouraged to use this API to help protect advertisers from spam and\n improve monetization for the web publishers that provided the content.\n\nNote that you can do either option, or even both, in the same app.\n\nThis guide is intended to help you integrate the WebView API for Ads into your\niOS app.\n\nBefore you begin\n\nBefore you start using the WebView API for Ads, make sure you do the following:\n\n- Use [Google Mobile Ads SDK for Flutter plugin](/admob/flutter/quick-start#import_the_mobile_ads_sdk) with version 3.0.0 or higher in your app.\n- Add [`webview_flutter`](//pub.dev/packages/webview_flutter) as a dependency in your `pubspec.yaml` file.\n- Add [`webview_flutter_android`](//pub.dev/packages/webview_flutter_android) with version 3.7.0 or higher in your app.\n\nBypass the check for application identifier \n\nAndroid\n\nAdd the following `\u003cmeta-data\u003e` tag in your `AndroidManifest.xml` file to\nbypass the check for the `APPLICATION_ID`. If you miss this step,\nGoogle Mobile Ads SDK might throw an\n[`IllegalStateException`](//developer.android.com/reference/java/lang/IllegalStateException)\non app start. \n\n \u003c!-- Bypass APPLICATION_ID check for WebView API for Ads --\u003e\n \u003cmeta-data\n android:name=\"com.google.android.gms.ads.INTEGRATION_MANAGER\"\n android:value=\"webview\"/\u003e\n\niOS\n\nUpdate the `Runner/Info.plist` file with the key and string value below to\nbypass a check for the `GADApplicationIdentifier`. If you miss this step,\nGoogle Mobile Ads SDK might throw a `GADInvalidInitializationException`\non app start. \n\n \u003c!-- Bypass GADApplicationIdentifier check for WebView API for Ads --\u003e\n \u003ckey\u003eGADIntegrationManager\u003c/key\u003e\n \u003cstring\u003ewebview\u003c/string\u003e\n\nRegister the WebViewController\n\nTo improve in-app ad monetization of ads within a\n`WebViewController` that uses [AdSense\ncode](//support.google.com/adsense/answer/9274634) or [Google Publisher\nTags](//support.google.com/admanager/answer/181073), follow the steps\nlisted below:\n\n1. Enable JavaScript in the `WebViewController`. Failure to do so can cause\n ads not to load.\n\n2. To improve your users' ad experience and be consistent with Chrome's\n [cookie policy](//policies.google.com/technologies/cookies), enable\n third-party cookies on your `AndroidWebViewController` instance.\n\n3. Register the `WebViewController` instance by calling the\n [`registerWebView()`](//pub.dev/documentation/google_mobile_ads/latest/google_mobile_ads/MobileAds/registerWebView.html)\n method provided by Google Mobile Ads SDK.\n\n import 'package:google_mobile_ads/google_mobile_ads.dart';\n import 'package:webview_flutter/webview_flutter.dart';\n import 'package:webview_flutter_android/webview_flutter_android.dart';\n\n @override\n class WebViewExampleState extends State\u003cWebViewExample\u003e {\n late final WebViewController controller;\n\n @override\n void initState() {\n super.initState();\n\n createWebView();\n }\n\n void createWebView() async {\n controller = WebViewController();\n // 1. Enable JavaScript in the web view.\n await controller.setJavaScriptMode(JavaScriptMode.unrestricted);\n // 2. Enable third-party cookies for Android.\n if (controller.platform is AndroidWebViewController) {\n AndroidWebViewCookieManager cookieManager = AndroidWebViewCookieManager(\n const PlatformWebViewCookieManagerCreationParams());\n await cookieManager.setAcceptThirdPartyCookies(\n controller.platform as AndroidWebViewController, true);\n }\n // 3. Register the web view.\n await MobileAds.instance.registerWebView(controller);\n }\n }\n\nLoad the URL\n\nYou can now load a URL and display your web content through `WebViewController`.\nWe recommend that you load this test URL:\n`https://google.github.io/webview-ads/test/` to test the integration prior to\nusing your own URL. The web page will show an error if JavaScript is not\nenabled. \n\n import 'package:google_mobile_ads/google_mobile_ads.dart';\n import 'package:webview_flutter/webview_flutter.dart';\n import 'package:webview_flutter_android/webview_flutter_android.dart';\n\n @override\n class WebViewExampleState extends State\u003cWebViewExample\u003e {\n late final WebViewController controller;\n\n @override\n void initState() {\n super.initState();\n\n createWebView();\n }\n\n void createWebView() async {\n controller = WebViewController();\n // 1. Enable JavaScript in the web view.\n await controller.setJavaScriptMode(JavaScriptMode.unrestricted);\n\n // 2. Enable third-party cookies for Android.\n if (controller.platform is AndroidWebViewController) {\n AndroidWebViewCookieManager cookieManager = AndroidWebViewCookieManager(\n const PlatformWebViewCookieManagerCreationParams());\n await cookieManager.setAcceptThirdPartyCookies(\n controller.platform as AndroidWebViewController, true);\n }\n\n // 3. Register the web view.\n await MobileAds.instance.registerWebView(controller);\n\n // 4. Load the URL.\n await controller.loadRequest(Uri.parse('https://google.github.io/webview-ads/test/'));\n }\n\nThe test URL shows green status bars for a successful integration if the\nfollowing conditions apply:\n\n- `WebView` connected to the Google Mobile Ads SDK\n- JavaScript enabled\n- Third-party cookies work (not expected on iOS devices)\n- First-party cookies work\n\nView the [source code](//github.com/google/webview-ads/blob/main/test/index.html)\nof our test URL. You can then replace the test URL with your URL. You can also\nuse a proxy tool such as [Charles](//www.charlesproxy.com/) to capture your\napp's HTTPS traffic and inspect the ad requests for a `&scar=` parameter."]]