diff --git a/gatsby-browser.js b/gatsby-browser.js index d0ebcb45e806..a082e14a9f1e 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -1,4 +1,5 @@ import "./fonts.css"; +import posthog from "posthog-js"; document.addEventListener("DOMContentLoaded", () => { /** init gtm after 3500 seconds - this could be adjusted */ @@ -28,5 +29,12 @@ function initGTM() { document.head.appendChild(script); } +posthog.init("phc_Yynjz2lAiQDJFqTWeGT0FJrt50hl53WBx8do3eKImgX", + { + api_host: "https://us.i.posthog.com", + person_profiles: "always", + } +); + export { wrapRootElement } from "./root-wrapper"; export { wrapPageElement } from "./page-wrapper"; diff --git a/package-lock.json b/package-lock.json index 040e331e8ccd..1b261b25cd0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,7 @@ "lodash": "^4.17.21", "mui-datatables": "^4.3.0", "path-browserify": "^1.0.1", + "posthog-js": "^1.161.6", "prism-react-renderer": "^1.3.5", "process": "^0.11.10", "prop-types": "^15.7.2", @@ -12085,6 +12086,11 @@ "pend": "~1.2.0" } }, + "node_modules/fflate": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", + "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==" + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -20908,6 +20914,25 @@ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, + "node_modules/posthog-js": { + "version": "1.161.6", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.161.6.tgz", + "integrity": "sha512-UO0z/YTuan55Kl5Yg9Xs5x1PKUkm2zGKUNPioznb4GLRcxFnLBkWoeKQXNro2YZsYJvK+MY8jlF3cdGa8BZ8/Q==", + "dependencies": { + "fflate": "^0.4.8", + "preact": "^10.19.3", + "web-vitals": "^4.0.1" + } + }, + "node_modules/posthog-js/node_modules/preact": { + "version": "10.24.0", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.24.0.tgz", + "integrity": "sha512-aK8Cf+jkfyuZ0ZZRG9FbYqwmEiGQ4y/PUO4SuTWoyWL244nZZh7bd5h2APd4rSNDYTBNghg1L+5iJN3Skxtbsw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/preact": { "version": "10.12.1", "resolved": "https://registry.npmjs.org/preact/-/preact-10.12.1.tgz", @@ -26294,6 +26319,11 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/web-vitals": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.3.tgz", + "integrity": "sha512-/CFAm1mNxSmOj6i0Co+iGFJ58OS4NRGVP+AWS/l509uIK5a1bSoIVaHz/ZumpHTfHSZBpgrJ+wjfpAOrTHok5Q==" + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/package.json b/package.json index a33f3fe6d733..f87971351503 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "lodash": "^4.17.21", "mui-datatables": "^4.3.0", "path-browserify": "^1.0.1", + "posthog-js": "^1.161.6", "prism-react-renderer": "^1.3.5", "process": "^0.11.10", "prop-types": "^15.7.2",