website: Add Fathom analytics (#11243)

* Impl Fathom analytics

* Use analytics package instead of direct impl

* Remove explicit fathom-client dep
This commit is contained in:
Noel Quiles 2021-10-14 00:33:38 -04:00 committed by GitHub
parent f8d2f03208
commit 88bd33cc6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View File

@ -10,6 +10,7 @@
"dependencies": {
"@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",
@ -768,6 +769,17 @@
"node": ">=4"
}
},
"node_modules/@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==",
"dependencies": {
"fathom-client": "^3.2.0"
},
"peerDependencies": {
"react": ">= 16.x"
}
},
"node_modules/@hashicorp/platform-cli": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@hashicorp/platform-cli/-/platform-cli-1.2.0.tgz",
@ -8028,6 +8040,11 @@
"reusify": "^1.0.4"
}
},
"node_modules/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/fd-slicer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
@ -20556,6 +20573,14 @@
}
}
},
"@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"
}
},
"@hashicorp/platform-cli": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@hashicorp/platform-cli/-/platform-cli-1.2.0.tgz",
@ -26332,6 +26357,11 @@
"reusify": "^1.0.4"
}
},
"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=="
},
"fd-slicer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",

View File

@ -6,6 +6,7 @@
"dependencies": {
"@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",

View File

@ -1,6 +1,7 @@
import './style.css'
import '@hashicorp/platform-util/nprogress/style.css'
import useFathomAnalytics from '@hashicorp/platform-analytics'
import Router from 'next/router'
import Head from 'next/head'
import NProgress from '@hashicorp/platform-util/nprogress'
@ -21,7 +22,9 @@ const { ConsentManager, openConsentManager } = createConsentManager({
})
export default function App({ Component, pageProps }) {
useFathomAnalytics()
useAnchorLinkAnalytics()
return (
<ErrorBoundary FallbackComponent={Error}>
<HashiHead