diff --git a/client/package-lock.json b/client/package-lock.json index 7ee5099..c6d0a9a 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -23,6 +23,7 @@ "next": "12.1.6", "react": "18.1.0", "react-dom": "18.1.0", + "react-gtm-module": "^2.0.11", "react-icons": "^4.10.1", "react-leaflet": "^4.2.1", "react-resize-detector": "^9.1.0", @@ -39,6 +40,7 @@ "@types/node": "17.0.36", "@types/react": "18.0.9", "@types/react-dom": "18.0.5", + "@types/react-gtm-module": "^2.0.3", "@types/styled-components": "^5.1.25", "@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/parser": "^5.29.0", @@ -1617,7 +1619,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, - "node_modules/@chakra-ui/select": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@chakra-ui/select/-/select-2.1.1.tgz", @@ -3201,6 +3202,12 @@ "@types/react": "*" } }, + "node_modules/@types/react-gtm-module": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/react-gtm-module/-/react-gtm-module-2.0.3.tgz", + "integrity": "sha512-fL2zKdDFN5LckSsVBXEhhm9M4tFTM9oHJfGcfZJzktQkzpOTGtDM8oXIP9d9UBDxO4xLNZhS22dlgRVv6wgK9w==", + "dev": true + }, "node_modules/@types/react-transition-group": { "version": "4.4.5", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz", @@ -8471,6 +8478,11 @@ } } }, + "node_modules/react-gtm-module": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/react-gtm-module/-/react-gtm-module-2.0.11.tgz", + "integrity": "sha512-8gyj4TTxeP7eEyc2QKawEuQoAZdjKvMY4pgWfycGmqGByhs17fR+zEBs0JUDq4US/l+vbTl+6zvUIx27iDo/Vw==" + }, "node_modules/react-icons": { "version": "4.10.1", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.10.1.tgz", @@ -10918,8 +10930,7 @@ }, "dependencies": { "@chakra-ui/accordion": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@chakra-ui/accordion/-/accordion-2.3.0.tgz", + "version": "https://registry.npmjs.org/@chakra-ui/accordion/-/accordion-2.3.0.tgz", "integrity": "sha512-A4TkRw3Jnt+Fam6dSSJ62rskdrvjF3JGctYcfXlojfFIpHPuIw4pDwfZgNAxlaxWkcj0e7JJKlQ88dnZW+QfFg==", "requires": { "@chakra-ui/descendant": "3.1.0", @@ -11127,6 +11138,40 @@ "integrity": "sha512-GbSfVb283+YA3kA8w8xWmzbjNWk14uhNpntnipHCftBibl0lxtQ9YqMFQLwuFOO0U2gYVocszqqDWX+XNKq9hw==", "requires": { "@chakra-ui/utils": "2.0.15" + }, + "dependencies": { + "@chakra-ui/utils": { + "version": "2.0.15", + "resolved": "https://registry.npmjs.org/@chakra-ui/utils/-/utils-2.0.15.tgz", + "integrity": "sha512-El4+jL0WSaYYs+rJbuYFDbjmfCcfGDmRY95GO4xwzit6YAPZBLcR65rOEwLps+XWluZTy1xdMrusg/hW0c1aAA==", + "requires": { + "@types/lodash.mergewith": "4.6.7", + "css-box-model": "1.2.1", + "framesync": "6.1.2", + "lodash.mergewith": "4.6.2" + } + }, + "@types/lodash.mergewith": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/@types/lodash.mergewith/-/lodash.mergewith-4.6.7.tgz", + "integrity": "sha512-3m+lkO5CLRRYU0fhGRp7zbsGi6+BZj0uTVSwvcKU+nSlhjA9/QRNfuSGnD2mX6hQA7ZbmcCkzk5h4ZYGOtk14A==", + "requires": { + "@types/lodash": "*" + } + }, + "framesync": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/framesync/-/framesync-6.1.2.tgz", + "integrity": "sha512-jBTqhX6KaQVDyus8muwZbBeGGP0XgujBRbQ7gM7BRdS3CadCZIHiawyzYLnafYcvZIh5j8WE7cxZKFn7dXhu9g==", + "requires": { + "tslib": "2.4.0" + } + }, + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + } } }, "@chakra-ui/select": { @@ -12337,6 +12382,12 @@ "@types/react": "*" } }, + "@types/react-gtm-module": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/react-gtm-module/-/react-gtm-module-2.0.3.tgz", + "integrity": "sha512-fL2zKdDFN5LckSsVBXEhhm9M4tFTM9oHJfGcfZJzktQkzpOTGtDM8oXIP9d9UBDxO4xLNZhS22dlgRVv6wgK9w==", + "dev": true + }, "@types/react-transition-group": { "version": "4.4.5", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz", @@ -16301,6 +16352,11 @@ "use-sidecar": "^1.1.2" } }, + "react-gtm-module": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/react-gtm-module/-/react-gtm-module-2.0.11.tgz", + "integrity": "sha512-8gyj4TTxeP7eEyc2QKawEuQoAZdjKvMY4pgWfycGmqGByhs17fR+zEBs0JUDq4US/l+vbTl+6zvUIx27iDo/Vw==" + }, "react-icons": { "version": "4.10.1", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.10.1.tgz", diff --git a/client/package.json b/client/package.json index c5ef9a2..fee5d1d 100644 --- a/client/package.json +++ b/client/package.json @@ -34,9 +34,10 @@ "next": "12.1.6", "react": "18.1.0", "react-dom": "18.1.0", + "react-gtm-module": "^2.0.11", + "react-icons": "^4.10.1", "react-leaflet": "^4.2.1", "react-resize-detector": "^9.1.0", - "react-icons": "^4.10.1", "react-responsive-carousel": "^3.2.23", "react-select": "^5.3.2", "styled-components": "^5.3.5" @@ -50,6 +51,7 @@ "@types/node": "17.0.36", "@types/react": "18.0.9", "@types/react-dom": "18.0.5", + "@types/react-gtm-module": "^2.0.3", "@types/styled-components": "^5.1.25", "@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/parser": "^5.29.0", diff --git a/client/pages/_app.tsx b/client/pages/_app.tsx index 97a7022..2d47d5e 100644 --- a/client/pages/_app.tsx +++ b/client/pages/_app.tsx @@ -1,6 +1,8 @@ import { ChakraProvider, extendTheme } from "@chakra-ui/react"; import { AppContextProvider } from "app-context"; import type { AppProps } from "next/app"; +import React, { useEffect } from "react"; +import TagManager from "react-gtm-module"; import "leaflet/dist/leaflet.css"; import "public/Marker.css"; const theme = extendTheme({ @@ -11,7 +13,14 @@ const theme = extendTheme({ }, }); +const tagManagerArgs = { + gtmId: "GTM-TWC8D9H", +}; + function MyApp({ Component, pageProps }: AppProps) { + useEffect(() => { + TagManager.initialize(tagManagerArgs); + }, []); return (