@@ -6,6 +6,7 @@ export default function Document() {
66 < Head >
77 { /* Meta tag verification */ }
88 < meta name = "google-adsense-account" content = "ca-pub-5179832879235237" />
9+ < meta name = "google-adsense-verification" content = "ca-pub-5179832879235237" />
910
1011 { /* AdSense Script */ }
1112 < script
@@ -19,11 +20,17 @@ export default function Document() {
1920 dangerouslySetInnerHTML = { {
2021 __html : `
2122 (function() {
22- window.adsbygoogle = window.adsbygoogle || [];
23- window.adsbygoogle.push({
24- google_ad_client: "ca-pub-5179832879235237",
25- enable_page_level_ads: true
26- });
23+ try {
24+ window.adsbygoogle = window.adsbygoogle || [];
25+ window.adsbygoogle.push({
26+ google_ad_client: "ca-pub-5179832879235237",
27+ enable_page_level_ads: true,
28+ overlays: {bottom: true}
29+ });
30+ console.log('AdSense initialized successfully');
31+ } catch (e) {
32+ console.error('AdSense initialization error:', e);
33+ }
2734 })();
2835 ` ,
2936 } }
@@ -32,6 +39,20 @@ export default function Document() {
3239 < body >
3340 < Main />
3441 < NextScript />
42+ { /* Fallback AdSense Script */ }
43+ < script
44+ dangerouslySetInnerHTML = { {
45+ __html : `
46+ if (!window.adsbygoogle) {
47+ var script = document.createElement('script');
48+ script.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5179832879235237';
49+ script.async = true;
50+ script.crossOrigin = 'anonymous';
51+ document.head.appendChild(script);
52+ }
53+ ` ,
54+ } }
55+ />
3556 </ body >
3657 </ Html >
3758 )
0 commit comments