این راهنما نحوه فعال کردن تبلیغات آزمایشی را در یکپارچه سازی تبلیغات خود توضیح می دهد. فعال کردن تبلیغات آزمایشی در حین توسعه بسیار مهم است تا بتوانید روی آنها کلیک کنید بدون اینکه هزینه ای از تبلیغ کنندگان Google دریافت کنید. اگر روی تبلیغات بیش از حد بدون قرار گرفتن در حالت آزمایشی کلیک کنید، در معرض خطر پرچم گذاری حساب شما برای فعالیت نامعتبر هستید.
دو راه برای دریافت تبلیغات آزمایشی وجود دارد:
از یکی از واحدهای تبلیغاتی نمونه گوگل استفاده کنید.
از واحد تبلیغات خود استفاده کنید و دستگاه های آزمایشی را فعال کنید.
سریعترین راه برای فعال کردن آزمایش، استفاده از واحدهای آگهی آزمایشی ارائهشده توسط Google است. این واحدهای تبلیغاتی با حساب Ad Manager شما مرتبط نیستند، بنابراین هیچ خطری برای ایجاد ترافیک نامعتبر در حساب شما در هنگام استفاده از این واحدهای تبلیغاتی وجود ندارد.
توجه به این نکته ضروری است که گوگل واحدهای تبلیغاتی آزمایشی مختلفی برای اندروید و iOS دارد. شما باید از یک واحد تبلیغ آزمایشی iOS برای ایجاد درخواستهای آگهی آزمایشی در iOS و از یک واحد تبلیغ آزمایشی Android برای درخواست در Android استفاده کنید.
این واحدهای تبلیغاتی به خلاقیت های آزمایشی خاصی اشاره می کنند.
دستگاه های تست را فعال کنید
اگر میخواهید آزمایشهای دقیقتری را با تبلیغات تولیدی انجام دهید، اکنون میتوانید دستگاه خود را بهعنوان یک دستگاه آزمایشی پیکربندی کنید و از شناسههای واحد تبلیغاتی خود که در رابط کاربری Ad Manager ایجاد کردهاید استفاده کنید.
مراحل زیر را دنبال کنید تا دستگاه خود را به عنوان یک دستگاه آزمایشی اضافه کنید.
دستگاه تست خود را به صورت برنامه ریزی شده اضافه کنید
اگر میخواهید تبلیغات را در برنامه خود در حین توسعه آزمایش کنید، مراحل زیر را دنبال کنید تا دستگاه آزمایشی خود را بصورت برنامهنویسی ثبت کنید.
برنامهای را اجرا کنید که با SDK تبلیغات موبایلی پیکربندی شده است و با استفاده از یکی از شناسههای واحد آگهی آزمایشی فهرستشده در بالا، درخواست تبلیغ کنید.
خروجی کنسول یا logcat را برای پیامی که شبیه این است بررسی کنید:
اندروید
I/Ads: Use
RequestConfiguration.Builder
.setTestDeviceIds(Arrays.asList("33BE2250B43518CCDA7DE426D04EE231"))
to get test ads on this device.
iOS
<Google> To get test ads on this device, set:
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers =
@[ @"2077ef9a63d2b398840261c8221a0c9b" ];
شناسه دستگاه تست الفبایی خود را در کلیپ بورد خود کپی کنید.
قبل از درخواست آگهی، کد خود را برای فراخوانی MobileAds.instance.updateRequestConfiguration با لیست شناسه های دستگاه آزمایشی خود تغییر دهید.
برنامه خود را دوباره اجرا کنید. اگر دستگاه خود را بهدرستی بهعنوان دستگاه آزمایشی اضافه کردهاید، یک برچسب آگهی آزمایشی را میبینید که در بالای آگهیهای بنر، بینابینی و تبلیغات پاداش قرار گرفته است:
تبلیغات با این برچسب آگهی آزمایشی قابل کلیک کردن هستند. هر گونه درخواست، نمایش و کلیک روی تبلیغات آزمایشی در گزارش های حساب شما نشان داده نمی شود.
اکنون که دستگاه شما بهعنوان یک دستگاه آزمایشی ثبت شده است، میتوانید با جایگزین کردن adUnitID آزمایشی با adUnitID خودتان، شروع به دریافت آگهیهای آزمایشی واقعیتر کنید.
تست با میانجیگری
واحدهای تبلیغاتی نمونه Google فقط Google Ads را نشان می دهد. برای آزمایش پیکربندی میانجیگری، باید دستگاههای آزمایشی را فعال کنید .
تبلیغات واسطهای برچسب آگهی آزمایشی ارائه نمیکنند. شما مسئول اطمینان از فعال بودن تبلیغات آزمایشی برای هر یک از شبکههای میانجی شما هستید تا این شبکهها حساب شما را برای فعالیت نامعتبر پرچمگذاری نکنند. برای اطلاعات بیشتر به [راهنمای میانجیگری هر شبکه] ((/ad-manager/mobile-ads-sdk/flutter/choose-networks#network_details) مراجعه کنید.
اگر مطمئن نیستید که یک آداپتور شبکه تبلیغاتی میانجی از تبلیغات آزمایشی پشتیبانی میکند یا خیر، مطمئنترین کار این است که در طول توسعه روی تبلیغات آن شبکه کلیک نکنید. میتوانید Ad.responseInfo در هر یک از قالبهای تبلیغاتی بررسی کنید تا بفهمید کدام شبکه تبلیغاتی تبلیغ فعلی را ارائه کرده است.
تاریخ آخرین بهروزرسانی 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 live ads.\u003c/p\u003e\n"],["\u003cp\u003eUse Google-provided sample ad units for quick testing or configure your device as a test device for more realistic scenarios with your own ad units.\u003c/p\u003e\n"],["\u003cp\u003eReplace test ad unit IDs with your own before publishing your app to serve live ads.\u003c/p\u003e\n"],["\u003cp\u003eWhen testing with mediation, ensure test ads are enabled for each ad network to prevent invalid activity concerns.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/ad-manager/mobile-ads-sdk/android/test-ads \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/test-ads \"View this page for the iOS platform docs.\") [Unity](/ad-manager/mobile-ads-sdk/unity/test-ads \"View this page for the Unity platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/flutter/test-ads \"View this page for the Flutter platform docs.\")\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 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 sample ad units.\n\n2. Use your own ad unit and enable test devices.\n\nPrerequisites\n\n- Complete [Get Started](/ad-manager/mobile-ads-sdk/flutter/quick-start).\n\n- [Import the Google Mobile Ads Flutter plugin](/ad-manager/mobile-ads-sdk/flutter/quick-start#import_the_mobile_ads_sdk) to your Flutter app.\n\nSample ad units\n\nThe quickest way to enable testing is to use Google-provided test ad units.\nThese ad units are not associated with your Ad Manager\naccount, so there's no risk of your account generating invalid traffic when\nusing these ad units.\n\nIt is important to note that Google has different test ad units for\n[Android](/ad-manager/mobile-ads-sdk/android/test-ads#demo_ad_units) and\n[iOS](/ad-manager/mobile-ads-sdk/ios/test-ads#demo_ad_units). You'll need to use an iOS test\nad unit for making test ad requests on iOS and an Android test ad unit for\nmaking requests on Android.\n\nThese ad units point to specific test creatives.\n| **Key Point:** Make sure you replace these test IDs with your own ad unit ID before publishing your app.\n\nEnable test devices\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 Ad Manager UI.\n\nFollow the steps below to add your device as a test device.\n| **Key Point:** Android emulators and iOS simulators are automatically configured as test devices.\n\nAdd your test device programmatically\n\nIf you want to test ads in your app as you're developing, follow the\nsteps below to programmatically register your test device.\n\n1. Run an app configured with the Mobile Ads SDK and make an ad request\n using one of the test ad unit IDs listed above.\n\n void loadBanner() {\n \n final adUnitId = '/21775744923/example/adaptive-banner';\n final bannerAd = AdManagerBannerAd(\n adUnitId: adUnitId,\n request: AdManagerAdRequest(),\n sizes: [AdSize.banner],\n );\n bannerAd.load();\n \n }\n\n2. Check the console or logcat output for a message that looks like this:\n\n Android \n\n ```\n I/Ads: Use\n RequestConfiguration.Builder\n .setTestDeviceIds(Arrays.asList(\"33BE2250B43518CCDA7DE426D04EE231\"))\n to get test ads on this device.\n ```\n\n iOS \n\n ```\n \u003cGoogle\u003e To get test ads on this device, set:\n GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers =\n @[ @\"2077ef9a63d2b398840261c8221a0c9b\" ];\n ```\n3. Copy your alphanumeric test device ID to your clipboard.\n\n4. Modify your code to call `MobileAds.instance.updateRequestConfiguration`\n with your test device IDs list before making the ad request.\n\n MobileAds.instance.updateRequestConfiguration(\n RequestConfiguration(testDeviceIds: ['33BE2250B43518CCDA7DE426D04EE231']));\n\n | Be sure to remove the code that sets these test devices before you release your app.\n5. Re-run your app. If you correctly added your device as a test device, you\n will see a **Test Ad** label centered at the top of banner, interstitial,\n and rewarded ads:\n\n\n Ads with this **Test Ad** label are safe to click. Any requests,\n impressions, and clicks on test ads don't show up in your account's\n reports.\n | Mediated ads DO NOT render a **Test Ad** label.\n6. Now that your device is registered as a test device, you can begin receiving\n more realistic test ads by replacing the test `adUnitID` with your own\n `adUnitID`.\n\nTesting with mediation\n\nGoogle's sample ad units only show Google Ads. To test your mediation\nconfiguration, you must\n[enable test devices](/ad-manager/mobile-ads-sdk/flutter/test-ads#enable_test_devices).\n\nMediated ads do NOT render a **Test Ad** label. You are responsible for ensuring\nthat test ads are enabled for each of your mediation networks so these networks\ndon't flag your account for invalid activity. See\n\\[each network's mediation guide\\]((/ad-manager/mobile-ads-sdk/flutter/choose-networks#network_details)\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 can\ncheck [`Ad.responseInfo`](/ad-manager/mobile-ads-sdk/flutter/mediation#check_which_ad_network_adapter_class_loaded_the_ad_2)\non any of the ad formats to figure out which ad network served the current ad."]]