-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added GoogleAnalytics & reduced event photos
- Loading branch information
1 parent
ff03844
commit e39795a
Showing
4 changed files
with
42 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import '@/styles/globals.css'; | ||
import { Poppins } from 'next/font/google'; | ||
import GoogleAnalytics from '@/lib/GoogleAnalytics'; | ||
|
||
const poppins = Poppins({ | ||
subsets: ['latin'], // Adjust subsets based on your language requirements | ||
weight: ['400', '700'], // Include the font weights you'll use | ||
variable: '--font-poppins', // Define a CSS variable to reference the font | ||
}); | ||
export const metadata = { | ||
title: 'GDG Montreal - DevFest 2024', | ||
description: 'GDG Montreal - DevFest 2024', | ||
title: 'GDG Montreal - DevFest 2024', description: 'GDG Montreal - DevFest 2024', | ||
}; | ||
|
||
export default function RootLayout({ children }) { | ||
return ( | ||
<html lang="en"> | ||
<body className={poppins.className}>{children}</body> | ||
</html> | ||
); | ||
return (<html lang="en"> | ||
<body className={poppins.className}> | ||
{children} | ||
<GoogleAnalytics /> | ||
</body> | ||
</html>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// components/GoogleAnalytics.js | ||
import Script from 'next/script'; | ||
|
||
const GoogleAnalytics = () => { | ||
return ( | ||
<> | ||
<Script | ||
strategy="afterInteractive" // Load after the page is interactive | ||
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GA_ID}`} | ||
/> | ||
<Script | ||
id="google-analytics" | ||
strategy="afterInteractive" | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', '${process.env.NEXT_PUBLIC_GA_ID}'); | ||
`, | ||
}} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default GoogleAnalytics; |