From bb5269043f81047d5ceac0ebb0c6a61a5c152070 Mon Sep 17 00:00:00 2001 From: RizqiSyahrendra Date: Tue, 11 Mar 2025 21:14:56 +0700 Subject: [PATCH] feat: gtm installation --- package.json | 1 + src/components/InitialScript.tsx | 7 ++++++- yarn.lock | 20 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a296a90..b21e973 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "tsc": "tsc" }, "dependencies": { + "@next/third-parties": "^15.2.2", "@payloadcms/db-postgres": "^3.20.0", "@payloadcms/next": "^3.20.0", "@payloadcms/payload-cloud": "^3.20.0", diff --git a/src/components/InitialScript.tsx b/src/components/InitialScript.tsx index ee97d94..fe14f36 100644 --- a/src/components/InitialScript.tsx +++ b/src/components/InitialScript.tsx @@ -5,6 +5,7 @@ import { init_wow } from "@/utils/initWow"; import { parallaxMouseMovement, parallaxScroll } from "@/utils/parallax"; import { usePathname } from "next/navigation"; import { useEffect } from "react"; +import { GoogleTagManager } from "@next/third-parties/google"; export default function InitialScript() { const path = usePathname(); @@ -36,5 +37,9 @@ export default function InitialScript() { } }, []); - return <>; + return ( + <> + + + ); } diff --git a/yarn.lock b/yarn.lock index ef4854d..1b8fe54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2410,6 +2410,18 @@ __metadata: languageName: node linkType: hard +"@next/third-parties@npm:^15.2.2": + version: 15.2.2 + resolution: "@next/third-parties@npm:15.2.2" + dependencies: + third-party-capital: "npm:1.0.20" + peerDependencies: + next: ^13.0.0 || ^14.0.0 || ^15.0.0 + react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 + checksum: 10c0/4e4c51d173f206b74205b82e4a74ff7556e96d45bef9ba5d30a648670868d3132173f588ec9818328d543c37043aebce3eb1b81db10f9f13605a53a5ffaa0c86 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -7592,6 +7604,7 @@ __metadata: resolution: "my-app@workspace:." dependencies: "@eslint/eslintrc": "npm:^3" + "@next/third-parties": "npm:^15.2.2" "@payloadcms/db-postgres": "npm:^3.20.0" "@payloadcms/next": "npm:^3.20.0" "@payloadcms/payload-cloud": "npm:^3.20.0" @@ -9793,6 +9806,13 @@ __metadata: languageName: node linkType: hard +"third-party-capital@npm:1.0.20": + version: 1.0.20 + resolution: "third-party-capital@npm:1.0.20" + checksum: 10c0/7f45ff156ec9d7e2957a5b39061be22b780ffbd2d93c127252d908e2bff6cdd09f827a95909d457c8096e036f155006a38e355a06ee11cb6d63c7f4b150bbfb0 + languageName: node + linkType: hard + "thread-stream@npm:^3.0.0": version: 3.1.0 resolution: "thread-stream@npm:3.1.0"