Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions apps/packid/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const geistMono = Geist_Mono({
subsets: ["latin"],
});

const GOOGLE_ANALYTICS_ID = "G-GEG23Y1E0M";
const GOOGLE_ANALYTICS_ID =
process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID || "G-GEG23Y1E0M";

export const metadata: Metadata = {
title: "Packid - Agent IA Recrutement",
Expand All @@ -38,7 +39,11 @@ export default function RootLayout({
return <AuthenticatedLayout>{children}</AuthenticatedLayout>;
}

async function AuthenticatedLayout({ children }: { children: React.ReactNode }) {
async function AuthenticatedLayout({
children,
}: {
children: React.ReactNode;
}) {
const headerStore = await headers();
const pathname = headerStore.get("x-packid-pathname") ?? "/";
const isApplicationPage = isApplicationPagePath(pathname);
Expand Down Expand Up @@ -80,9 +85,9 @@ async function AuthenticatedLayout({ children }: { children: React.ReactNode })
<Analytics />
<Script
src={`https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_ID}`}
strategy="afterInteractive"
strategy="beforeInteractive"
/>
<Script id="google-analytics" strategy="afterInteractive">
<Script id="google-analytics" strategy="beforeInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
Expand Down
Loading