टेस्टिंग के मोड
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
adBreak() इंटिग्रेशन की जांच करें
adBreak()
एपीआई का इस्तेमाल करने वाले JavaScript कोड की जांच करने के लिए, हम जांच मोड उपलब्ध कराते हैं. इसे adsbygoogle.js
पर data-adbreak-test="on"
एट्रिब्यूट जोड़कर चालू किया जा सकता है:
<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>
टेस्टिंग मोड:
- कुछ ऐसी सुरक्षा सुविधाओं को बंद कर देता है जिनकी वजह से लोकल टेस्टिंग मुश्किल होती है, जैसे कि फ़्रीक्वेंसी कैप.
- असली विज्ञापनों का अनुरोध करने के बजाय मॉक विज्ञापन दिखाता है.
ध्यान दें: टेस्टिंग मोड की मदद से, Google के सर्वर पर विज्ञापन अनुरोध भेजे बिना ही, क्लाइंट-साइड JavaScript की जांच की जा सकती है. इससे आपको AdSense कोड के गलत कॉन्फ़िगरेशन से जुड़ी समस्याओं का पता लगाने में मदद नहीं मिल सकती. जैसे, `data-ad-client` की अमान्य वैल्यू.
टेस्ट मोड दो स्थितियों के बीच चलता है: विज्ञापन को लोड किया जाता है और विज्ञापन को
ऐसे असली माहौल के लिए लोड नहीं किया जाता जहां विज्ञापन हमेशा उपलब्ध नहीं होगा.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2023-10-31 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","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 (UTC) को अपडेट किया गया."],[[["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"]]