این راهنما نحوه فعال کردن تبلیغات آزمایشی را در یکپارچه سازی تبلیغات خود توضیح می دهد. مهم است که تبلیغات آزمایشی را در طول توسعه فعال کنید تا بتوانید بدون پرداخت هزینه از تبلیغکنندگان Google، روی آنها کلیک کنید. اگر روی تبلیغات بیش از حد بدون قرار گرفتن در حالت آزمایشی کلیک کنید، خطر پرچم گذاری حساب شما برای فعالیت نامعتبر وجود دارد.
سریعترین راه برای فعال کردن آزمایش، استفاده از واحدهای تبلیغات نمایشی ارائه شده توسط Google است. این واحدهای تبلیغاتی با حساب AdMob شما مرتبط نیستند، بنابراین هیچ خطری برای ایجاد ترافیک نامعتبر در حساب شما در هنگام استفاده از این واحدهای تبلیغاتی وجود ندارد.
در اینجا واحدهای تبلیغاتی نمایشی هستند که به خلاقیت های آزمایشی خاصی برای هر قالب اشاره می کنند:
اگر میخواهید آزمایشهای دقیقتری با تبلیغات تولیدی انجام دهید، اکنون میتوانید دستگاه خود را بهعنوان یک دستگاه آزمایشی پیکربندی کنید و از شناسههای واحد تبلیغاتی خود که در رابط کاربری AdMob ایجاد کردهاید استفاده کنید. دستگاههای آزمایشی را میتوان به رابط کاربری AdMob اضافه کرد یا با استفاده از Google Mobile Ads SDK به صورت برنامهنویسی.
مراحل زیر را دنبال کنید تا دستگاه خود را به عنوان یک دستگاه آزمایشی اضافه کنید.
دستگاه آزمایشی خود را در رابط کاربری AdMob اضافه کنید
برای یک روش غیربرنامهای برای افزودن یک دستگاه آزمایشی و آزمایش ساختهای برنامه جدید یا موجود، از رابط کاربری AdMob استفاده کنید. یاد بگیرید چگونه .
دستگاه تست خود را به صورت برنامه ریزی شده اضافه کنید
برای ثبت دستگاه تست خود مراحل زیر را انجام دهید:
برنامه ادغام شده با تبلیغات خود را بارگیری کنید و درخواست تبلیغات کنید.
خروجی logcat را برای پیامی مشابه پیام زیر بررسی کنید که شناسه دستگاه شما و نحوه اضافه کردن آن را به عنوان یک دستگاه آزمایشی به شما نشان می دهد:
I/Ads: Use RequestConfiguration.Builder.setTestDeviceIds(Arrays.asList("33BE2250B43518CCDA7DE426D04EE231"))
to get test ads on this device."
شناسه دستگاه آزمایشی خود را در کلیپ بورد خود کپی کنید.
شناسه دستگاه آزمایشی خود را جایگزین TEST_DEVICE_ID کنید.
میتوانید بهصورت اختیاری isTestDevice() بررسی کنید تا تأیید کنید که دستگاه شما بهدرستی بهعنوان دستگاه آزمایشی اضافه شده است.
برنامه خود را دوباره اجرا کنید. اگر تبلیغ یک تبلیغ Google باشد، یک برچسب آگهی آزمایشی را در قسمت بالای آگهی (برنما، ویدیوی بینابینی یا پاداش) خواهید دید:
برای تبلیغات پیشرفته بومی، دارایی عنوان با رشته آگهی آزمایشی اضافه می شود.
تبلیغات با این برچسب آگهی آزمایشی قابل کلیک کردن هستند. درخواستها، نمایشها و کلیکها روی تبلیغات آزمایشی در گزارشهای حساب شما نشان داده نمیشوند.
تست با میانجیگری
واحدهای تبلیغاتی نمونه Google فقط Google Ads را نشان می دهد. برای آزمایش پیکربندی AdMob Mediation، باید از روش فعال کردن دستگاههای آزمایشی استفاده کنید.
تبلیغات واسطهای برچسب آگهی آزمایشی ارائه نمیکنند . شما مسئول اطمینان از فعال بودن تبلیغات آزمایشی برای هر یک از شبکههای میانجی شما هستید تا این شبکهها حساب شما را برای فعالیت نامعتبر پرچمگذاری نکنند. برای اطلاعات بیشتر، راهنمای میانجیگری مربوط به هر شبکه را ببینید.
اگر مطمئن نیستید که یک آداپتور شبکه تبلیغاتی میانجی از تبلیغات آزمایشی پشتیبانی میکند یا خیر، مطمئنترین کار این است که در طول توسعه روی تبلیغات آن شبکه کلیک نکنید. میتوانید از متد getMediationAdapterClassName() در هر یک از قالبهای تبلیغاتی استفاده کنید تا بفهمید کدام شبکه تبلیغاتی تبلیغ فعلی را ارائه کرده است.
تاریخ آخرین بهروزرسانی 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\u003eEnable test ads during development to avoid invalid activity flags on your account by preventing accidental clicks on real ads.\u003c/p\u003e\n"],["\u003cp\u003eUse Google-provided demo ad units for quick testing or configure your device as a test device for more rigorous testing with your own ad unit IDs.\u003c/p\u003e\n"],["\u003cp\u003eRemember to replace demo ad unit IDs with your own before publishing and remove test device IDs from your code.\u003c/p\u003e\n"],["\u003cp\u003eFor mediation testing, enable test ads for each network individually, as mediated ads do not display the "Test Ad" label.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003egetMediationAdapterClassName()\u003c/code\u003e to identify the ad network serving the current ad when unsure about a network's test ad support.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/admob/android/test-ads \"View this page for the Android platform docs.\") [iOS](/admob/ios/test-ads \"View this page for the iOS platform docs.\") [Unity](/admob/unity/test-ads \"View this page for the Unity platform docs.\") [Flutter](/admob/flutter/test-ads \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\n\n\u003cbr /\u003e\n\nThis guide explains how to enable test ads in your ads integration. It's\nimportant to enable test ads during development so that you can click them\nwithout charging Google advertisers. If you click 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).\n2. Use your own ad unit and [enable test devices](#enable_test_devices).\n\nPrerequisite\n\n- Complete [Get Started](/admob/android/quick-start).\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\naccount, so there's no risk of your account generating invalid traffic when\nusing 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\n| Ad format | Demo ad unit ID |\n|---------------------------------------------------------------|------------------------------------------|\n| [App Open](/admob/android/app-open) | `ca-app-pub-3940256099942544/9257395921` |\n| [Adaptive Banner](/admob/android/banner) | `ca-app-pub-3940256099942544/9214589741` |\n| [Fixed Size Banner](/admob/android/banner/fixed-size) | `ca-app-pub-3940256099942544/6300978111` |\n| [Interstitial](/admob/android/interstitial) | `ca-app-pub-3940256099942544/1033173712` |\n| [Rewarded Ads](/admob/android/rewarded) | `ca-app-pub-3940256099942544/5224354917` |\n| [Rewarded Interstitial](/admob/android/rewarded-interstitial) | `ca-app-pub-3940256099942544/5354046379` |\n| [Native](/admob/android/native) | `ca-app-pub-3940256099942544/2247696110` |\n| [Native Video](/admob/android/native/video-ads) | `ca-app-pub-3940256099942544/1044960115` |\n\nEnable test devices\n\nIf you want to do more rigorous testing with production-looking ads, you can\nnow configure your device as a test device and use your own ad unit IDs that\nyou've created in the AdMob UI.\n\nTest devices can either be added in the AdMob UI or programmatically using\nGoogle Mobile Ads SDK.\n\n\nFollow the steps below to add your device as a test device.\n| **Key Point:** Android emulators are automatically configured as test devices.\n\nAdd your test device in the AdMob UI\n\nFor a non-programmatic way to add a test device and test new or existing\napp builds, use the AdMob UI. [Learn\nhow](//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\nTo register your test device, complete the following steps:\n\n1. Load your ads-integrated app and make an ad request.\n2. Check the logcat output for a message similar to the following, which shows you your device ID and how to add it as a test device: \n\n ```text\n I/Ads: Use RequestConfiguration.Builder.setTestDeviceIds(Arrays.asList(\"33BE2250B43518CCDA7DE426D04EE231\"))\n to get test ads on this device.\"\n ```\n Copy your test device ID to your clipboard.\n3. Modify your code to call\n\n [`RequestConfiguration.Builder.setTestDeviceIds()`](/admob/android/reference/com/google/android/gms/ads/RequestConfiguration.Builder#setTestDeviceIds(java.util.List%3Cjava.lang.String%3E))\n\n and pass in a list of your test device IDs.\n\n Java \n\n List\u003cString\u003e testDeviceIds = Arrays.asList(\"\u003cvar translate=\"no\"\u003eTEST_DEVICE_ID\u003c/var\u003e\");\n RequestConfiguration configuration =\n new RequestConfiguration.Builder().setTestDeviceIds(testDeviceIds).build();\n MobileAds.setRequestConfiguration(configuration); \n https://github.com/googleads/googleads-mobile-android-examples/blob/ccc290a583d7f552bdcf81ea76adc05beaa43f0b/java/advanced/APIDemo/app/src/main/java/com/google/android/gms/snippets/RequestConfigurationSnippets.java#L15-L18\n\n Kotlin \n\n val testDeviceIds = listOf(\"\u003cvar translate=\"no\"\u003eTEST_DEVICE_ID\u003c/var\u003e\")\n val configuration = RequestConfiguration.Builder().setTestDeviceIds(testDeviceIds).build()\n MobileAds.setRequestConfiguration(configuration) \n https://github.com/googleads/googleads-mobile-android-examples/blob/ccc290a583d7f552bdcf81ea76adc05beaa43f0b/kotlin/advanced/APIDemo/app/src/main/java/com/google/android/gms/snippets/RequestConfigurationSnippets.kt#L27-L29\n\n Replace \u003cvar translate=\"no\"\u003eTEST_DEVICE_ID\u003c/var\u003e with your test device ID.\n\n You can optionally check\n\n [`isTestDevice()`](/admob/android/reference/com/google/android/gms/ads/AdRequest#isTestDevice(android.content.Context))\n\n to confirm that your device was properly added as a test device.\n | **Caution:** Be sure to remove the code that sets these test device IDs before you release your app.\n4. Re-run your app. If the ad is a Google ad, you'll see a **Test Ad** label\n centered at the top of the ad (banner, interstitial, or rewarded video):\n\n | **Note:** To see the **Test Ad** label, you need to be using an SDK version of 11.6.0 or higher.\n\n For native advanced ads, the headline asset is prepended with the string **Test Ad**.\n\nAds with this **Test Ad** label are safe to click. Requests, impressions, and\nclicks on test ads won't show up in your account's reports.\n| **Note:** Mediated ads do *NOT* render a **Test Ad** label. See the following section for details.\n\nTesting with mediation\n\nGoogle's sample ad units only show Google Ads. To test your\nAdMob Mediation configuration,\nyou must use the [enable test devices](#enable_test_devices)\napproach.\n\nMediated ads do *NOT* render a Test Ad label. You are responsible for\nensuring that test ads are enabled for each of your mediation networks so these\nnetworks don't flag your account for invalid activity. See each network's\nrespective [mediation guide](/admob/android/mediation)\nfor more information.\n\nIf you aren't sure whether a mediation ad network adapter supports test ads, it\nis safest to avoid clicking on ads from that network during development. You\ncan use the\n\n[`getMediationAdapterClassName()`](/admob/android/reference/com/google/android/gms/ads/ResponseInfo#getMediationAdapterClassName())\n\nmethod on any of the ad formats to figure out which ad network served the\ncurrent ad."]]