From 08a0f32a6e20b94bae4ccfaafa52d38a5ba364a9 Mon Sep 17 00:00:00 2001 From: Noel Quiles <3746694+EnMod@users.noreply.github.com> Date: Wed, 13 Oct 2021 18:03:23 -0400 Subject: [PATCH] website: Add Fathom analytics (#1579) * Impl Fathom analytics * Use analytics package instead of direct impl --- website/package-lock.json | 57 +++++++++++++++++++++++++++++++-------- website/package.json | 2 ++ website/pages/_app.js | 3 +++ 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/website/package-lock.json b/website/package-lock.json index aa8d23459f..a085e664e7 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -1614,6 +1614,14 @@ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz", "integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==" }, + "@hashicorp/platform-analytics": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@hashicorp/platform-analytics/-/platform-analytics-0.1.0.tgz", + "integrity": "sha512-kR/E0KWemjazSrSFN9l22v8JqlQvkgjgkZHPJEhGiBt05LMtt2ugxIakv+gnzW5lU9434nnr7oDooUyj4eufPA==", + "requires": { + "fathom-client": "^3.2.0" + } + }, "node_modules/@hashicorp/react-text-input/node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -2295,9 +2303,13 @@ "version": "11.1.2", "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-11.1.2.tgz", "integrity": "sha512-hZuwOlGOwBZADA8EyDYyjx3+4JGIGjSHDHWrmpI7g5rFmQNltjlbaefAbiU5Kk7j3BUSDwt30quJRFv3nyJQ0w==", - "cpu": ["arm64"], + "cpu": [ + "arm64" + ], "optional": true, - "os": ["darwin"], + "os": [ + "darwin" + ], "engines": { "node": ">= 10" } @@ -2306,9 +2318,13 @@ "version": "11.1.2", "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-11.1.2.tgz", "integrity": "sha512-PGOp0E1GisU+EJJlsmJVGE+aPYD0Uh7zqgsrpD3F/Y3766Ptfbe1lEPPWnRDl+OzSSrSrX1lkyM/Jlmh5OwNvA==", - "cpu": ["x64"], + "cpu": [ + "x64" + ], "optional": true, - "os": ["darwin"], + "os": [ + "darwin" + ], "engines": { "node": ">= 10" } @@ -2317,9 +2333,13 @@ "version": "11.1.2", "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-11.1.2.tgz", "integrity": "sha512-YcDHTJjn/8RqvyJVB6pvEKXihDcdrOwga3GfMv/QtVeLphTouY4BIcEUfrG5+26Nf37MP1ywN3RRl1TxpurAsQ==", - "cpu": ["x64"], + "cpu": [ + "x64" + ], "optional": true, - "os": ["linux"], + "os": [ + "linux" + ], "engines": { "node": ">= 10" } @@ -2328,9 +2348,13 @@ "version": "11.1.2", "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-11.1.2.tgz", "integrity": "sha512-e/pIKVdB+tGQYa1cW3sAeHm8gzEri/HYLZHT4WZojrUxgWXqx8pk7S7Xs47uBcFTqBDRvK3EcQpPLf3XdVsDdg==", - "cpu": ["x64"], + "cpu": [ + "x64" + ], "optional": true, - "os": ["win32"], + "os": [ + "win32" + ], "engines": { "node": ">= 10" } @@ -5640,7 +5664,9 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "devOptional": true, - "engines": ["node >= 0.8"], + "engines": [ + "node >= 0.8" + ], "peer": true, "dependencies": { "buffer-from": "^1.0.0", @@ -7546,6 +7572,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "fathom-client": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fathom-client/-/fathom-client-3.2.0.tgz", + "integrity": "sha512-WF/qA5wXYSuA5K8uiIhGNbErOcTAmfLEWrBxWP2px2dEc9waH9zxjdh9k0F907VCBhdJrv+f7V3HT/Pmro40zA==" + }, "node_modules/eslint/node_modules/ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -8740,7 +8771,9 @@ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "hasInstallScript": true, "optional": true, - "os": ["darwin"], + "os": [ + "darwin" + ], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -19443,7 +19476,9 @@ "dev": true, "hasInstallScript": true, "optional": true, - "os": ["darwin"], + "os": [ + "darwin" + ], "peer": true, "dependencies": { "bindings": "^1.5.0", diff --git a/website/package.json b/website/package.json index fe0a933572..58a842a6e4 100644 --- a/website/package.json +++ b/website/package.json @@ -7,6 +7,7 @@ "@apidevtools/json-schema-ref-parser": "9.0.9", "@hashicorp/mktg-global-styles": "^4.0.0", "@hashicorp/mktg-logos": "^1.2.0", + "@hashicorp/platform-analytics": "^0.1.0", "@hashicorp/platform-code-highlighting": "^0.1.2", "@hashicorp/platform-runtime-error-monitoring": "^0.1.0", "@hashicorp/platform-util": "^0.1.0", @@ -32,6 +33,7 @@ "classnames": "2.2.6", "next": "^11.1.2", "next-mdx-remote": "^3.0.4", + "fathom-client": "^3.2.0", "next-remote-watch": "1.0.0", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/website/pages/_app.js b/website/pages/_app.js index 7a3080ad86..a5ba752b7f 100644 --- a/website/pages/_app.js +++ b/website/pages/_app.js @@ -1,5 +1,7 @@ import './style.css' import '@hashicorp/platform-util/nprogress/style.css' + +import useFathomAnalytics from '@hashicorp/platform-analytics' import NProgress from '@hashicorp/platform-util/nprogress' import createConsentManager from '@hashicorp/react-consent-manager/loader' import useAnchorLinkAnalytics from '@hashicorp/platform-util/anchor-link-analytics' @@ -23,6 +25,7 @@ const description = 'Boundary is an open source solution that automates a secure identity-based user access to hosts and services across environments.' export default function App({ Component, pageProps }) { + useFathomAnalytics() useAnchorLinkAnalytics() return (