// Set a sample device ID of 2077ef9a63d2b398840261c8221a0c9bfirebase::gma::RequestConfigurationrequest_configuration=firebase::gma::GetRequestConfiguration();request_configuration.test_device_ids.push_back("2077ef9a63d2b398840261c8221a0c9b");firebase::gma::SetRequestConfiguration(request_configuration);
重新运行您的应用。如果植入的广告是 Google 广告,则您会在广告(横幅广告、插页式广告或激励广告)顶部的中间部分看到一个测试模式标签:
凡是带有 Test mode 标签的广告,均可以放心点击。在测试模式下,广告的请求、展示和点击数据都不会显示在您账号的报告中。
使用中介进行测试
Google 的演示广告单元只展示 Google 广告。如需测试中介配置,您必须使用“启用测试设备”的做法。
[null,null,["最后更新时间 (UTC):2025-02-25。"],[[["The Google Mobile Ads C++ SDK is deprecated and will be end-of-maintenance on June 17, 2025; consider using the iOS or Android SDKs instead."],["During development, utilize test ads by using Google's demo ad units or enabling test mode to prevent invalid activity flags on your account."],["Replace demo ad unit IDs with your own before publishing and remember that Android and iOS simulators are automatically configured as test devices."],["When enabling test mode programmatically, ensure to remove the test device ID code before releasing your app."],["Mediated ads do not display a \"Test mode\" label; consult each network's mediation guide to ensure test mode is enabled and avoid clicking ads from networks without a confirmed test mode during development."]]],["The Google Mobile Ads C++ SDK is deprecated as of June 17, 2024, with maintenance ending June 17, 2025; AdMob's iOS and Android SDKs are recommended replacements. To test ads, use Google's demo ad units or enable test mode with your own. Demo units prevent invalid traffic, while test mode lets you configure your device, either in the AdMob UI or programmatically via the SDK, and use your own ad unit IDs. If using mediated ads, ensure each network is in test mode.\n"]]