Skip to content

Commit

Permalink
Adding Umami
Browse files Browse the repository at this point in the history
  • Loading branch information
markojak committed Oct 18, 2022
1 parent 9f7a34e commit 3226c84
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@ import '../styles/globals.css'
import type { AppProps } from 'next/app'

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
return (
<>
{process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL &&
process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID && (
<Script
src={process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL}
data-website-id={process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID}
strategy="lazyOnload"
/>
)}

<Component {...pageProps} />
</>
)
}

export default MyApp

0 comments on commit 3226c84

Please sign in to comment.