File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55<div class =" in-article-ad-container" >
66 <span class =" ad-label" >Advertisement</span >
77 <ins
8- class =" adsbygoogle"
9- style =" display:block; text-align:center;"
10- data-ad-layout =" in-article"
11- data-ad-format =" fluid"
12- data-ad-client =" ca-pub-7993314093599705"
13- data-ad-slot =" 8594941706" ></ins >
8+ class =" adsbygoogle"
9+ style =" display:block; text-align:center;"
10+ data-ad-layout =" in-article"
11+ data-ad-format =" fluid"
12+ data-ad-client =" ca-pub-7993314093599705"
13+ data-ad-slot =" 8594941706" ></ins >
14+ <script is:inline >
15+ (adsbygoogle = window.adsbygoogle || []).push({});
16+ </script >
1417 <span class =" ad-label" >Advertisement</span >
1518</div >
1619
1720<style >
1821 .in-article-ad-container {
19- display: none; /* Hidden by default, shown via script for specific instances */
22+ display: block;
2023 margin: 2rem 0;
2124 text-align: center;
2225 overflow: hidden;
Original file line number Diff line number Diff line change @@ -260,13 +260,16 @@ const components = {
260260 // Show the ad
261261 (ad as HTMLElement).style.display = ' block' ;
262262
263- // Trigger AdSense
264- try {
265- console.log(` H2Ad: Pushing ad #${index + 1 } to adsbygoogle ` );
266- ((window as any).adsbygoogle = (window as any).adsbygoogle || []).push({});
267- } catch (e) {
268- console.error(` H2Ad: AdSense push failed for ad #${index + 1 } ` , e);
269- }
263+ // Trigger AdSense with a staggered delay (e.g., 500ms apart)
264+ // This prevents race conditions or rate limiting when pushing multiple ads
265+ setTimeout(() => {
266+ try {
267+ console.log(` H2Ad: Pushing ad #${index + 1 } to adsbygoogle ` );
268+ ((window as any).adsbygoogle = (window as any).adsbygoogle || []).push({});
269+ } catch (e) {
270+ console.error(` H2Ad: AdSense push failed for ad #${index + 1 } ` , e);
271+ }
272+ } , 500 * index + 100);
270273 });
271274 });
272275 </script >
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments