diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4a2235d..46857db 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -70,10 +70,11 @@ export default function RootLayout({ children }: { children: React.ReactNode }) name="google-site-verification" content="t_GK2K5w97K3W9jIuzdmPKGu-STw4fagx-5jYQib4yE" /> - {/* Adsterra Network Script */} -
diff --git a/src/components/AdSlot.tsx b/src/components/AdSlot.tsx index d16cf40..0acf6a5 100644 --- a/src/components/AdSlot.tsx +++ b/src/components/AdSlot.tsx @@ -12,7 +12,7 @@ export default function AdSlot({ slot, format = "auto", className = "" }: AdSlot (null); - +export default function SidebarAd({ slotId, format = "vertical", className = "" }: SidebarAdProps) { useEffect(() => { - if (!containerRef.current) return; try { - const script = document.createElement("script"); - script.src = "https://pl31295441.profitableratecpmnetwork.com/fd/4a/91/fd4a9155d8cc10399821f613377ee9f1.js"; - script.async = true; - containerRef.current.appendChild(script); + if (typeof window !== "undefined") { + // @ts-expect-error Google ads window object + (window.adsbygoogle = window.adsbygoogle || []).push({}); + } } catch { - // Ignore network blocks + // Ignore if AdSense blocked by client } }, []); @@ -34,7 +31,15 @@ export default function SidebarAd({ format = "vertical", className = "" }: Sideb Ad - + {/* Google AdSense Unit */} + ); }