From 46b627e12429c1210929e4935c51087fd3a73bf7 Mon Sep 17 00:00:00 2001 From: Ubinquitous Date: Fri, 29 Dec 2023 08:00:57 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EA=B5=AC=EA=B8=80=20=EC=95=A0?= =?UTF-8?q?=EB=84=90=EB=A6=AC=ED=8B=B1=EC=8A=A4=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gtag.d.ts | 3 +++ package.json | 1 + src/app/layout.tsx | 21 +++++++++++++++++++++ src/hooks/useGtag.ts | 40 ++++++++++++++++++++++++++++++++++++++++ yarn.lock | 5 +++++ 5 files changed, 70 insertions(+) create mode 100644 gtag.d.ts create mode 100644 src/hooks/useGtag.ts diff --git a/gtag.d.ts b/gtag.d.ts new file mode 100644 index 00000000..e02ce14e --- /dev/null +++ b/gtag.d.ts @@ -0,0 +1,3 @@ +/// + +declare module "gtag.js"; diff --git a/package.json b/package.json index 6738feab..c638524d 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "@semantic-release/npm": "^9.0.1", "@semantic-release/release-notes-generator": "^10.0.3", "@types/graphql": "^14.5.0", + "@types/gtag.js": "^0.0.18", "@types/jest": "^29.2.4", "@types/react-beautiful-dnd": "^13.1.3", "@types/react-slick": "^0.23.12", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 40415dcf..8f60a6d5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,7 @@ import Provider from "@/provider/MainProvider"; import React from "react"; +import * as gtag from "@/hooks/useGtag"; +import Script from "next/script"; export const metadata = { title: "BSM", @@ -11,8 +13,27 @@ export default function RootLayout({ }: { children: React.ReactNode; }) { + gtag.useGtag(); return ( +