diff --git a/public/ads.txt b/public/ads.txt
new file mode 100644
index 0000000..2c5cb51
--- /dev/null
+++ b/public/ads.txt
@@ -0,0 +1 @@
+google.com, pub-3004906966180197, DIRECT, f08c47fec0942fa0
\ No newline at end of file
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 8cc4c20..54b0955 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -1,7 +1,9 @@
import { NextLayout, NextProvider } from '@/components/Provider';
import { pretendard } from '@/utils/fonts';
import { cn } from '@/utils/style';
+import { GoogleAnalytics, GoogleTagManager } from '@next/third-parties/google';
import type { Metadata } from 'next';
+import Script from 'next/script';
import './globals.css';
export const metadata: Metadata = {
@@ -48,13 +50,6 @@ export default function RootLayout({
}>) {
return (
-
-
-
{children}
+
+
+ {/* Google Analytics */}
+ {process.env.GOOGLE_ANALYTICS && (
+
+ )}
+
+ {/* Google Tag Manager */}
+ {process.env.GOOGLE_TAG && (
+
+ )}
+
+ {/* Google AdSense */}
+ {process.env.GOOGLE_ADSENSE_CLIENT_ID && (
+
+ )}
);
diff --git a/src/components/GoogleAdSenseComponent.tsx b/src/components/GoogleAdSenseComponent.tsx
new file mode 100644
index 0000000..bad2e9c
--- /dev/null
+++ b/src/components/GoogleAdSenseComponent.tsx
@@ -0,0 +1,25 @@
+'use client';
+
+import { useEffect } from 'react';
+
+declare global {
+ interface Window {
+ adsbygoogle: any;
+ }
+}
+
+export const GoogleAdSenseComponent = () => {
+ useEffect(() => {
+ (window.adsbygoogle = window.adsbygoogle || []).push({});
+ }, []);
+
+ return (
+
+ );
+};
diff --git a/src/components/Provider.tsx b/src/components/Provider.tsx
index 09cd6bc..02dab3a 100644
--- a/src/components/Provider.tsx
+++ b/src/components/Provider.tsx
@@ -1,10 +1,8 @@
'use client';
-import { GoogleAnalytics, GoogleTagManager } from '@next/third-parties/google';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { SessionProvider } from 'next-auth/react';
-import Head from 'next/head';
import { Suspense } from 'react';
import Footer from './Footer/Footer';
import Header from './Header/Header';
@@ -40,29 +38,7 @@ export const NextProvider = ({ children }: Props) => {
export const NextLayout = ({ children }: Props) => {
return (
-
-
-
- {/* Google Analytics */}
- {process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS && (
-
- )}
-
- {/* Google Tag Manager */}
- {process.env.NEXT_PUBLIC_GOOGLE_TAG && (
-
- )}
-
- {/* Google AdSense */}
- {process.env.NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID && (
-
- )}
-
-
+
{children}