أوضاع الاختبار
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
اختبار دمج adBreak()
لاختبار رمز JavaScript الذي يستخدم adBreak()
API، نوفّر وضع اختبار يمكن تفعيله من خلال إضافة السمة data-adbreak-test="on"
على adsbygoogle.js
:
<script async
data-adbreak-test="on"
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-123456789"
crossorigin="anonymous">
</script>
<script>
window.adsbygoogle = window.adsbygoogle || [];
var adBreak = adConfig = function(o) {adsbygoogle.push(o);}
</script>
وضع الاختبار:
- لإيقاف بعض إجراءات الحماية التي تجعل الاختبار المحلي صعبًا، مثل
تحديد عدد مرات الظهور.
- تعرض إعلانات وهمية بدلاً من طلب إعلانات حقيقية.
ملاحظة: لا يسمح لك وضع الاختبار إلا باختبار JavaScript من جهة العميل بدون إرسال طلبات الإعلان إلى خوادم Google. ولا يمكنها مساعدتك في اكتشاف المشاكل المرتبطة بالإعداد الخاطئ لرمز AdSense، مثل قيم "data-ad-client" غير صالحة.
ويتغيّر وضع الاختبار بين سيناريوهين: يتم تحميل الإعلان ولا يتم تحميل الإعلان لمحاكاة بيئة حقيقية لا يتوفّر فيها الإعلان دائمًا.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2023-10-31 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 2023-10-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["Testing mode for `adBreak()` is enabled by adding `data-adbreak-test=\"on\"` to the `adsbygoogle.js` script tag."],["This mode displays mock ads, mimics real ad behavior (like frequency capping), and allows debugging with `console.log` or breakpoints."],["It's for testing client-side JavaScript only and doesn't detect AdSense code misconfigurations."],["The test mode cycles between scenarios where ads are and aren't loaded to simulate real-world conditions."]]],["To test `adBreak()` API integration, enable testing mode by adding `data-adbreak-test=\"on\"` to the `adsbygoogle.js` script. This mode displays mock ads, mimicking real ad behavior, but does not send real ad requests. It cycles between ad loaded and not loaded scenarios. Use `console.log` or breakpoints to debug `adBreakDone()` and `placementInfo`. This method helps test client-side JavaScript, but it cannot detect issues related to AdSense code misconfiguration.\n"]]