Skip to content

Commit 5f81613

Browse files
committed
use script
1 parent 3c8d9c4 commit 5f81613

File tree

3 files changed

+12
-32
lines changed

3 files changed

+12
-32
lines changed

package-lock.json

-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"ndarray": "^1.0.19",
5050
"next": "^14.2.22",
5151
"next-mdx-remote": "^4.1.0",
52-
"next-plausible": "^3.12.4",
5352
"react": "^18.2.0",
5453
"react-animate-height": "^2.0.23",
5554
"react-dom": "^18.2.0",

pages/_app.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import PlausibleProvider from 'next-plausible'
2+
import Script from 'next/script'
33
import { ThemeProvider } from 'theme-ui'
44
import '@carbonplan/components/fonts.css'
55
import '@carbonplan/components/globals.css'
@@ -8,15 +8,17 @@ import theme from '@carbonplan/theme'
88

99
const App = ({ Component, pageProps }) => {
1010
return (
11-
<PlausibleProvider
12-
domain='carbonplan.org'
13-
trackOutboundLinks
14-
trackFileDownloads
15-
>
16-
<ThemeProvider theme={theme}>
17-
<Component {...pageProps} />
18-
</ThemeProvider>
19-
</PlausibleProvider>
11+
<ThemeProvider theme={theme}>
12+
{process.env.NEXT_PUBLIC_VERCEL_ENV === 'production' && (
13+
<Script
14+
strategy='lazyOnload'
15+
data-domain='carbonplan.org'
16+
data-api='https://carbonplan.org/proxy/api/event'
17+
src='https://carbonplan.org/js/script.file-downloads.outbound-links.js'
18+
/>
19+
)}
20+
<Component {...pageProps} />
21+
</ThemeProvider>
2022
)
2123
}
2224

0 commit comments

Comments
 (0)