feat: add Google Analytics tracking
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
765a944c11
commit
8a39e5a401
|
|
@ -1,9 +1,12 @@
|
|||
import type { Metadata } from "next";
|
||||
import Script from "next/script";
|
||||
import "./globals.css";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import LayoutClient from "./layout-client";
|
||||
import { Providers } from "./providers";
|
||||
|
||||
const GA_TRACKING_ID = "G-E272LVVQRD";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Thé Tip Top - Jeu Concours",
|
||||
description: "Participez au grand jeu-concours Thé Tip Top et gagnez des lots exceptionnels ! 100% de tickets gagnants.",
|
||||
|
|
@ -37,6 +40,20 @@ export const metadata: Metadata = {
|
|||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<Script
|
||||
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
<Script id="google-analytics" strategy="afterInteractive">
|
||||
{`
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '${GA_TRACKING_ID}');
|
||||
`}
|
||||
</Script>
|
||||
</head>
|
||||
<body className="min-h-screen flex flex-col bg-gray-50">
|
||||
<Providers>
|
||||
<LayoutClient>{children}</LayoutClient>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user