AdMob 미디에이션은 AdMob 네트워크, 제3자 광고 네트워크,
AdMob 캠페인 등 다양한 소스를 통해 앱에 광고를
게재할 수 있는 기능입니다. AdMob 미디에이션을 이용하면 여러 네트워크에 광고 요청을 전송하여 광고 게재를 위한 최적의 네트워크를 찾을 수 있으므로 유효노출률을 극대화하고 수익을 늘리는 데 도움이 됩니다.
우수사례
기본 요건
광고 형식에 적합한 미디에이션 기능을 통합하기 전에 해당 광고 형식을 앱에 통합해야 합니다.
빠른 시작 가이드에서는 모바일 광고 SDK를 초기화하는 방법을 보여줍니다.
초기화 호출 중에는 미디에이션 어댑터도 초기화됩니다. 첫 번째 광고 요청에 모든 광고 네트워크가 참여할 수 있도록 하려면 광고를 로드하기 전에 초기화가 완료될 때까지 기다려야 합니다.
아래의 샘플 코드에서는 광고 요청을 하기 전에 각 어댑터의 초기화 상태를
확인하는 방법을 보여줍니다.
// Initialize the Google Mobile Ads libraryfirebase::gma::Initialize(*app);// In a game loop, monitor the initialization statusautoinitialize_future=firebase::gma::InitializeLastResult();if(initialize_future.status()==firebase::kFutureStatusComplete&&
initialize_future.error()==firebase::gma::kAdErrorCodeNone){// Initialization completed successfully, log the adapter status:std::map<std::string,firebase::gma::AdapterStatus>adapter_status_map=firebase::gma::GetInitializationStatus().GetAdapterStatusMap();for(autoit=adapter_status_map.begin();it!=adapter_status_map.end();++it){std::stringadapter_class_name=it->first;firebase::gma::AdapterStatusadapter_status=it->second;printf(“adapter:%s\tdescription:%s\tis_initialized:%dlatency:%d\n”,adapter_class_name.c_str(),adapter_status.description().c_str(),adapter_status.is_initialized(),adpater_status.latency());}}else{// Handle initialization error.}
각 광고 결과에는 현재 광고를 가져온 광고 네트워크의 클래스 이름에 관한 정보가 포함됩니다.
다음은 AdView에서 반환된 AdResult에서 광고 네트워크 클래스 이름을 기록하는 샘플 코드입니다. 전면 광고 및 보상형 광고에도 유사한 코드를 사용할 수 있습니다.
firebase::Future<AdResult>load_ad_future=banner_view.loadAd(ad_request);// In a game loop, monitor the ad load statusif(load_ad_future.status()==firebase::kFutureStatusComplete&&
load_ad_future.error()==firebase::gma::kAdErrorCodeNone){constAdResult*ad_result=load_ad_future.result();printf(“Loadedadwithadapterclassname:%s\n”,ad_result->adapter_class_name().c_str());}else{// Handle the load ad error.}
배너 광고 미디에이션
모든 서드 파티 광고 네트워크 UI에서 AdMob 미디에이션에 사용되는 배너 광고 단위의 새로고침을 사용 중지하세요. 배너 광고 단위의 새로고침 빈도에 따라 AdMob에서도 새로고침을 실행하므로 위와 같이 조치하면 이중 새로고침을 방지할 수 있습니다.
[null,null,["최종 업데이트: 2025-09-02(UTC)"],[[["\u003cp\u003eThe Google Mobile Ads C++ SDK is deprecated and will be end-of-maintenance on June 17, 2025; developers should use the iOS and Android SDKs instead.\u003c/p\u003e\n"],["\u003cp\u003eAdMob Mediation allows you to serve ads from multiple sources, including AdMob Network, third-party ad networks, and AdMob campaigns to maximize your fill rate and increase monetization.\u003c/p\u003e\n"],["\u003cp\u003eBefore integrating mediation, you must integrate the desired ad format (Banner, Interstitial, or Rewarded) into your app.\u003c/p\u003e\n"],["\u003cp\u003eInitialize the Mobile Ads SDK to ensure mediation adapters are initialized and wait for initialization to complete before loading ads for full ad network participation.\u003c/p\u003e\n"],["\u003cp\u003eFurther configuration and installation of mediation adapters are platform-specific (Android and iOS), so refer to the respective platform guides for detailed instructions.\u003c/p\u003e\n"]]],["The Google Mobile Ads C++ SDK is deprecated as of June 17, 2024, with maintenance ending June 17, 2025; developers should use the iOS and Android AdMob SDKs instead. AdMob Mediation allows serving ads from multiple sources to maximize fill rate. Before using mediation, integrate the ad formats (banner, interstitial, rewarded). Initialization of the Mobile Ads SDK includes mediation adapters. Developers can check adapter status and monitor ad network class names. For banner ads, disable refresh in third-party networks to prevent double refreshes. Further mediation configuration requires per-platform setup for Android and iOS.\n"],null,["| **DEPRECATED:** The Google Mobile Ads C++ SDK is *deprecated* as of June 17, 2024 and should not be adopted in projects that don't already use it. It will enter *End-of-Maintenance (EoM)* on June 17, 2025. Note that versions of the SDK released before the EoM date will continue to function, but no further bug fixes or changes will be released after the EoM date.\n|\n| Instead of the Google Mobile Ads C++ SDK, consider using the\n| [iOS](/admob/ios/quick-start) and\n| [Android](/admob/android/quick-start) SDKs from AdMob.\n| For support, reach out to the\n| [Google Mobile Ads SDK Technical Forum](https://groups.google.com/g/google-admob-ads-sdk).\n\n\u003cbr /\u003e\n\nAdMob Mediation is a feature that lets you serve ads to your apps from\nmultiple sources, including the AdMob Network, third-party ad networks, and\n[AdMob campaigns](//support.google.com/admob/answer/6162747). AdMob Mediation\nhelps maximize your fill rate and increase your monetization by sending ad\nrequests to multiple networks to ensure you find the best available network to\nserve ads.\n[Case study](//admob.google.com/home/resources/cookapps-grows-ad-revenue-86-times-with-admob-rewarded-ads-and-mediation/).\n\nPrerequisites\n\nBefore you can integrate mediation for an ad format, you need to integrate that\nad format into your app:\n\n- [Banner](/admob/cpp/banner)\n- [Interstitial](/admob/cpp/interstitial)\n- [Rewarded](/admob/cpp/rewarded)\n\nNew to mediation? Read [Overview of AdMob\nmediation](//support.google.com/admob/answer/3063564).\n\nInitialize the Mobile Ads SDK\n\nThe quick start guide shows you how to [initialize the Mobile Ads\nSDK](/admob/cpp/quick-start#initialize_the_mobile_ads_sdk).\nDuring that initialization call, mediation adapters also get\ninitialized. It is important to wait for initialization to complete before you\nload ads in order to ensure full participation from every ad network on the\nfirst ad request.\n\nThe sample code below shows how you can check each adapter's initialization\nstatus prior to making an ad request. \n\n // Initialize the Google Mobile Ads library\n firebase::gma::Initialize(*app);\n\n // In a game loop, monitor the initialization status\n auto initialize_future = firebase::gma::InitializeLastResult();\n\n if (initialize_future.status() == firebase::kFutureStatusComplete &&\n initialize_future.error() == firebase::gma::kAdErrorCodeNone) {\n // Initialization completed successfully, log the adapter status:\n std::map\u003cstd::string, firebase::gma::AdapterStatus\u003e adapter_status_map =\n firebase::gma::GetInitializationStatus().GetAdapterStatusMap();\n\n for (auto it = adapter_status_map.begin(); it != adapter_status_map.end(); ++it) {\n std::string adapter_class_name = it-\u003efirst;\n firebase::gma::AdapterStatus adapter_status = it-\u003esecond;\n printf(\"adapter: %s \\t description: %s \\t is_initialized: %d latency: %d\\n\",\n adapter_class_name.c_str(),\n adapter_status.description().c_str(),\n adapter_status.is_initialized(),\n adpater_status.latency());\n }\n } else {\n // Handle initialization error.\n }\n\nFor more information about working with Futures, see\n[Use Futures to monitor the completion status of method\ncalls](/admob/cpp/quick-start#futures).\n\nCheck the value of `adNetworkClassName`\n\nEach ad result contains information about the class name of the ad network that\nfetched the current ad.\n\nHere is a sample code that logs the ad network class name from an `AdResult`\nreturned from an `AdView`. Similar code can be used for interstitial and\nrewarded ads: \n\n firebase::Future\u003cAdResult\u003e load_ad_future = banner_view.loadAd(ad_request);\n\n // In a game loop, monitor the ad load status\n if (load_ad_future.status() == firebase::kFutureStatusComplete &&\n load_ad_future.error() == firebase::gma::kAdErrorCodeNone) {\n const AdResult* ad_result = load_ad_future.result();\n printf(\"Loaded ad with adapter class name: %s\\n\",\n ad_result-\u003eadapter_class_name().c_str());\n } else {\n // Handle the load ad error.\n }\n\nBanner ads mediation\n\nMake sure to disable refresh in all third-party ad networks UI for banner ad\nunits used in AdMob Mediation. This will prevent a double refresh since AdMob\nalso triggers a refresh based on your banner ad unit's refresh rate.\n\nNext steps\n\nThe Google Mobile Ads C++ SDK wraps the Android and iOS SDK implementations for\nmediation. Therefore further configuration, including the installation of\nmediation adapters, is specific to the Android and iOS platforms. For more\ninformation, see the [Google Mobile Ads Android SDK Choose networks\nguide](/admob/android/choose-networks) and the [Google\nMobile Ads iOS SDK Choose networks\nguide](/admob/ios/choose-networks)."]]