diff --git a/components/Advertisement.tsx b/components/Advertisement.tsx index d770ecb..f3c7f71 100644 --- a/components/Advertisement.tsx +++ b/components/Advertisement.tsx @@ -5,12 +5,18 @@ const Advertisement: React.FC = ({ size = 'short' }) => { useEffect(() => { if (process.env.NODE_ENV === 'production') { window.adsbygoogle = window.adsbygoogle || [] - window.adsbygoogle.push({}) + try { + window.adsbygoogle.push({}) + Logger.debug('Ad Pushed') + } + catch { + Logger.debug('Ad Push Fail') + } } - Logger.debug('Ads Pushed') + }, []) - return ( + return
= ({ size = 'short' }) => { > {process.env.NODE_ENV === 'production' ? ( + data-adtest='on' + /> ) : ( 'Advertisement' )}
- ) +
} declare global { diff --git a/pages/_document.tsx b/pages/_document.tsx index 950ea75..c6f74fa 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -53,11 +53,7 @@ class MyDocument extends Document { {/* SCRIPT */} - +