Skip to content

Commit

Permalink
switch to plausible
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane98c committed Feb 3, 2025
1 parent fa4a7b7 commit bde580d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"ndarray-concat-cols": "^1.0.0",
"next": "^14.2.22",
"next-mdx-remote": "^4.1.0",
"next-plausible": "^3.12.4",
"react": "^18.2.0",
"react-animate-height": "^2.0.23",
"react-dom": "^18.2.0",
Expand Down
18 changes: 13 additions & 5 deletions pages/_app.page.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React from 'react'
import PlausibleProvider from 'next-plausible'
import { ThemeProvider } from 'theme-ui'
import '@carbonplan/components/fonts.css'
import '@carbonplan/components/globals.css'
Expand All @@ -7,11 +9,17 @@ import { ScrollProvider } from '../components/scroll'

const App = ({ Component, pageProps }) => {
return (
<ThemeProvider theme={theme}>
<ScrollProvider>
<Component {...pageProps} />
</ScrollProvider>
</ThemeProvider>
<PlausibleProvider
domain='carbonplan.org'
trackOutboundLinks
trackFileDownloads
>
<ThemeProvider theme={theme}>
<ScrollProvider>
<Component {...pageProps} />
</ScrollProvider>
</ThemeProvider>
</PlausibleProvider>
)
}

Expand Down
5 changes: 1 addition & 4 deletions pages/_document.page.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import Document, { Html, Main, NextScript, Head } from 'next/document'
import { Tracking } from '@carbonplan/components'
import { InitializeColorMode } from 'theme-ui'

class MyDocument extends Document {
render() {
return (
<Html lang='en' className='no-focus-outline'>
<Head>
<Tracking id={process.env.GA_TRACKING_ID} />
</Head>
<Head />
<body>
<InitializeColorMode />
<Main />
Expand Down

0 comments on commit bde580d

Please sign in to comment.