add support for google tag manager (#62)

This commit is contained in:
Dave Horton
2023-05-07 09:16:58 -04:00
committed by GitHub
parent 8b6847b572
commit 5a98730474
3 changed files with 31 additions and 8 deletions

27
package-lock.json generated
View File

@@ -20,6 +20,7 @@
"react": "npm:@preact/compat",
"react-dom": "npm:@preact/compat",
"react-feather": "^2.0.10",
"react-gtm-module": "^2.0.11",
"react-ssr-prepass": "npm:preact-ssr-prepass"
},
"devDependencies": {
@@ -1512,9 +1513,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001383",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz",
"integrity": "sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg==",
"version": "1.0.30001486",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001486.tgz",
"integrity": "sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg==",
"funding": [
{
"type": "opencollective",
@@ -1523,6 +1524,10 @@
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
]
},
@@ -5638,6 +5643,11 @@
"react": ">=16.8.6"
}
},
"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-is": {
"version": "16.13.1",
"license": "MIT"
@@ -8088,9 +8098,9 @@
"dev": true
},
"caniuse-lite": {
"version": "1.0.30001383",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz",
"integrity": "sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg=="
"version": "1.0.30001486",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001486.tgz",
"integrity": "sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg=="
},
"caseless": {
"version": "0.12.0",
@@ -10660,6 +10670,11 @@
"prop-types": "^15.7.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-is": {
"version": "16.13.1"
},

View File

@@ -34,6 +34,7 @@
"react": "npm:@preact/compat",
"react-dom": "npm:@preact/compat",
"react-feather": "^2.0.10",
"react-gtm-module": "^2.0.11",
"react-ssr-prepass": "npm:preact-ssr-prepass"
},
"devDependencies": {

View File

@@ -1,5 +1,12 @@
import '../src/styles/global.scss';
import { useEffect } from 'react'
import TagManager from 'react-gtm-module'
const gtmId = 'G-7J55WH6BVM';
export default function App({ Component, pageProps }) {
return <Component {...pageProps} />;
}
useEffect(() => {
TagManager.initialize({ gtmId })
}, []);
return <Component {...pageProps} />
}