با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این راهنما نحوه دریافت تبلیغات آزمایشی را در یکپارچه سازی تبلیغات خود توضیح می دهد. استفاده از تبلیغات آزمایشی در حین توسعه بسیار مهم است تا بتوانید روی آنها کلیک کنید بدون اینکه هزینه ای از تبلیغ کنندگان Google دریافت کنید. اگر روی تبلیغات بیش از حد بدون قرار گرفتن در حالت آزمایشی کلیک کنید، در معرض خطر پرچم گذاری حساب شما برای فعالیت نامعتبر هستید.
سریعترین راه برای فعال کردن آزمایش، استفاده از واحدهای تبلیغات نمایشی ارائه شده توسط Google است. این واحدهای تبلیغاتی با حساب AdMob شما مرتبط نیستند، بنابراین هیچ خطری برای ایجاد ترافیک نامعتبر در حساب شما در هنگام استفاده از این واحدهای تبلیغاتی وجود ندارد.
در اینجا واحدهای تبلیغاتی نمایشی هستند که به خلاقیت های آزمایشی خاصی برای هر قالب اشاره می کنند:
اگر میخواهید آزمایشهای دقیقتری با تبلیغات تولیدی انجام دهید، اکنون میتوانید دستگاه خود را بهعنوان یک دستگاه آزمایشی پیکربندی کنید و از شناسههای واحد تبلیغاتی خود که در رابط کاربری AdMob ایجاد کردهاید استفاده کنید. دستگاههای آزمایشی را میتوان به رابط کاربری AdMob اضافه کرد یا با استفاده از Google Mobile Ads SDK به صورت برنامهنویسی.
مراحل زیر را دنبال کنید تا دستگاه خود را به عنوان یک دستگاه آزمایشی اضافه کنید.
دستگاه آزمایشی خود را در رابط کاربری AdMob اضافه کنید
برای یک روش ساده و غیربرنامهای برای افزودن یک دستگاه آزمایشی و آزمایش ساختهای برنامه جدید یا موجود، از رابط کاربری AdMob استفاده کنید. یاد بگیرید چگونه .
دستگاه تست خود را به صورت برنامه ریزی شده اضافه کنید
اگر میخواهید تبلیغات را در برنامه خود در حین توسعه آزمایش کنید، مراحل زیر را دنبال کنید تا دستگاه آزمایشی خود را بصورت برنامهنویسی ثبت کنید.
برنامه ادغام شده با تبلیغات خود را بارگیری کنید و درخواست تبلیغات کنید.
شناسه دستگاه آزمایشی خود را در کلیپ بورد خود کپی کنید.
کد خود را برای تنظیم شناسه دستگاه آزمایشی از طریق SetRequestConfiguration تغییر دهید:
// 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 باشد، یک برچسب حالت آزمایشی را در مرکز بالای آگهی خواهید دید (برنما، تبلیغات بینابینی یا پاداش):
تبلیغات با این برچسب حالت تست قابل کلیک کردن است. درخواستها، نمایشها و کلیکها روی تبلیغات در حالت آزمایشی در گزارشهای حساب شما نشان داده نمیشوند.
تست با میانجیگری
واحدهای تبلیغات نمایشی Google فقط تبلیغات Google را نشان می دهند. برای آزمایش پیکربندی میانجیگری، باید از روش فعال کردن دستگاههای تست استفاده کنید.
تبلیغات واسطهای برچسب حالت آزمایشی ارائه نمیکنند. شما مسئول اطمینان از فعال بودن حالت آزمایشی برای هر یک از شبکههای میانجی شما هستید تا این شبکهها حساب شما را برای فعالیت نامعتبر پرچمگذاری نکنند. برای اطلاعات بیشتر، راهنمای میانجیگری مربوط به هر شبکه را ببینید.
اگر مطمئن نیستید که یک آداپتور شبکه تبلیغاتی میانجی یک حالت آزمایشی را ارائه میکند یا خیر، ایمنترین کار این است که در طول توسعه روی تبلیغات آن شبکه کلیک نکنید. میتوانید از روش ResponseInfo::mediation_adapter_class_name() در هر یک از قالبهای تبلیغاتی استفاده کنید تا بفهمید کدام شبکه تبلیغاتی تبلیغ فعلی را ارائه میکند.
تاریخ آخرین بهروزرسانی 2025-09-06 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-09-06 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe 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.\u003c/p\u003e\n"],["\u003cp\u003eDuring development, utilize test ads by using Google's demo ad units or enabling test mode to prevent invalid activity flags on your account.\u003c/p\u003e\n"],["\u003cp\u003eReplace demo ad unit IDs with your own before publishing and remember that Android and iOS simulators are automatically configured as test devices.\u003c/p\u003e\n"],["\u003cp\u003eWhen enabling test mode programmatically, ensure to remove the test device ID code before releasing your app.\u003c/p\u003e\n"],["\u003cp\u003eMediated 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.\u003c/p\u003e\n"]]],["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"],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\nThis guide explains how to receive test ads in your ads integration. It is\nimportant to use test ads during development so that you can click on them\nwithout charging Google advertisers. If you click on too many ads without being\nin test mode, you risk your account being flagged for invalid activity.\n\nThere are two ways to get test ads:\n\n1. Use one of Google's [demo ad units](#demo_ad_units).\n\n2. Use your own ad unit and [enable test mode](#enable_test_devices).\n\nDemo ad units\n\nThe quickest way to enable testing is to use Google-provided demo ad units.\nThese ad units are not associated with your AdMob account, so there's no risk of\nyour account generating invalid traffic when using these ad units.\n| **Key Point:** Make sure you replace these IDs with your own ad unit ID before publishing your app.\n\nHere are demo ad units that point to specific test creatives for each format: \n\nAndroid\n\n| Ad format | Sample ad unit ID |\n|-----------------------------------------|------------------------------------------|\n| [Banner](/admob/cpp/banner) | `ca-app-pub-3940256099942544/6300978111` |\n| [Interstitial](/admob/cpp/interstitial) | `ca-app-pub-3940256099942544/1033173712` |\n| [Rewarded](/admob/cpp/rewarded) | `ca-app-pub-3940256099942544/5224354917` |\n\niOS\n\n| Ad format | Sample ad unit ID |\n|-----------------------------------------|------------------------------------------|\n| [Banner](/admob/cpp/banner) | `ca-app-pub-3940256099942544/2934735716` |\n| [Interstitial](/admob/cpp/interstitial) | `ca-app-pub-3940256099942544/4411468910` |\n| [Rewarded](/admob/cpp/rewarded) | `ca-app-pub-3940256099942544/1712485313` |\n\nEnable test devices (Test mode)\n\nIf you want to do more rigorous testing with production-looking ads, you can now\nconfigure your device as a test device and use your own ad unit IDs that you've\ncreated in the AdMob UI. Test devices can either be added in the AdMob UI or\nprogrammatically using the Google Mobile Ads SDK.\n\nFollow the steps below to add your device as a test device.\n| **Key Point:** Android and iOS simulators are automatically configured as test devices.\n\nAdd your test device in the AdMob UI\n\nFor a simple, non-programmatic way to add a test device and test new or existing\napp builds, use the AdMob UI.\n[Learn how](//support.google.com/admob/answer/9691433).\n| **Key Point:** New test devices typically start serving test ads in your app within 15 minutes, but it can also take up to 24 hours.\n\nAdd your test device programmatically\n\nIf you want to test ads in your app as you're developing, follow the steps below\nto programmatically register your test device.\n\n1. Load your ads-integrated app and make an ad request.\n\n2. Check the console for a message that looks like this:\n\n Android \n\n ```c++\n I/Ads: Use RequestConfiguration.Builder.setTestDeviceIds(Arrays.asList(\"33BE2250B43518CCDA7DE426D04EE231\"))\n to get test ads on this device.\"\n \n ```\n\n iOS \n\n ```c++\n \u003cGoogle\u003e To get test ads on this device, set:\n GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @\"2077ef9a63d2b398840261c8221a0c9b\" ];\n \n ```\n\n Copy your test device ID to your clipboard.\n | **Note:** Be sure to remove the code that sets these test device IDs before you release your app.\n3. Modify your code to set the test device ID through `SetRequestConfiguration`:\n\n ```c++\n // Set a sample device ID of 2077ef9a63d2b398840261c8221a0c9b\n firebase::gma::RequestConfiguration request_configuration =\n firebase::gma::GetRequestConfiguration();\n request_configuration.test_device_ids.push_back(\"2077ef9a63d2b398840261c8221a0c9b\");\n firebase::gma::SetRequestConfiguration(request_configuration);\n ```\n4. Re-run your app. If the ad is a Google ad, you'll see a **Test mode** label\n centered at the top of the ad (banner, interstitial, or rewarded ad):\n\nAds with this **Test mode** label are safe to click. Requests, impressions, and\nclicks on ads in test mode will not show up in your account's reports.\n| **Key Point:** Mediated ads do NOT render a **Test mode** label. See the section below for details.\n\nTesting with mediation\n\nGoogle's demo ad units only show Google ads. To test your mediation\nconfiguration, you must use the [enable test devices](#enable_test_devices)\napproach.\n\nMediated ads do not render a **Test mode** label. You are responsible for ensuring\nthat test mode is enabled for each of your mediation networks so that these\nnetworks don't flag your account for invalid activity. See each network's\nrespective [mediation guide](/admob/cpp/mediation) for more\ninformation.\n\nIf you aren't sure whether a mediation ad network adapter provides a test mode,\nit is safest to avoid clicking on ads from that network during development. You\ncan use the `ResponseInfo::mediation_adapter_class_name()` method on any of the\nad formats to figure out which ad network served the current ad."]]