Skip to content

Commit

Permalink
feat: setup optional plausible
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght committed Jul 8, 2024
1 parent e2c37af commit 1cd942e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export default async function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
const usePlausible = process.env.plausible;

const cookieStore = cookies();

const serverUrl = `${process.env.URL}/api/graphql`;
Expand All @@ -36,6 +38,15 @@ export default async function RootLayout({

return (
<html lang={locale} suppressHydrationWarning>
{usePlausible ? (
<head>
<script
defer
data-domain="mibanco.app"
src="https://plausible.io/js/script.js"
/>
</head>
) : null}
<body className={font.className}>
<NextIntlClientProvider messages={messages}>
<ThemeProvider
Expand Down

0 comments on commit 1cd942e

Please sign in to comment.