Skip to content

Commit

Permalink
Added GoogleAnalytics & reduced event photos
Browse files Browse the repository at this point in the history
  • Loading branch information
Solankimimoh committed Sep 1, 2024
1 parent ff03844 commit e39795a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 36 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Deploy Next.js site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -28,6 +28,8 @@ jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_GA_ID: ${{ secrets.NEXT_PUBLIC_GA_ID }} # Key for Google Analytics
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
15 changes: 8 additions & 7 deletions src/app/layout.js
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>);
}
32 changes: 4 additions & 28 deletions src/data/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export const organizers = [
website: 'https://gdsc.community.dev/concordia-university-montreal-canada/',
},
{
logo: '/images/organizers/gdsc_mcgill.svg',
company: 'GSDC McGill',
website: 'https://gdsc.community.dev/mcgill-university-montreal-canada/',
}
logo: '/images/organizers/gdsc_mcgill.svg',
company: 'GSDC McGill',
website: 'https://gdsc.community.dev/mcgill-university-montreal-canada/',
},
];

export const sponsors = [
Expand Down Expand Up @@ -79,28 +79,4 @@ export const eventPhotos = [
{
title: 'DevFest 2023 was so much fun.',
image: 'https://lh3.googleusercontent.com/pw/AP1GczNcaSw3Sh12JA8gYo0eTp6REZyoogQJPdhyIsbx3m3tb4MpG_jC-gG-r3h8YU65idL3U8qruJeuIw4cP-JVo41f8kLJYSTFncp8iAO_vbtnl7CX2MYzNzppvfedVXC5II8kNGfrNUV5XOHw8LATa7V4=w1401-h934-s-no-gm?authuser=0',
},
{
title: 'DevFest 2023 was so much fun.',
image: 'https://lh3.googleusercontent.com/pw/AP1GczM_7Wr2marvIZ8IslJbKNvnzno5Ch9BwEsLQeosSgqU3PTo8tQSU_Z_eZSyGdH_hStmDAkX3OO_EzCs-Vy_f5Te5_dwGNXDLjZpU-8n0CWKn0EpmP0EWdb2oTyfmhumwLnbdA35VqjWryYuhXLGnBrk=w1401-h934-s-no-gm?authuser=0',
},
{
title: 'DevFest 2023 was so much fun.',
image: 'https://lh3.googleusercontent.com/pw/AP1GczMZ6KQ5eaHcgACIvpAZXda7_hPItUTgmkP704UaaJOfmXvLCd4PaQfqF05PVjfJG3sVgiG6S4PV4cr6Z7o3_dJEQeKWaiVtnmfPMl13h23f3ITo3Pq3mZCbKiZcHw7YyOPnj16dCNYCzt4UKJ81-pxq=w1401-h934-s-no-gm?authuser=0',
},
{
title: 'DevFest 2023 was so much fun.',
image: 'https://lh3.googleusercontent.com/pw/AP1GczNJc_FpCr8OHeI1Da_BoMV0mj5FNOi4zyBFnoTxaV4ijfFXrIExDNqyosLc-TZNEFDX1XaEwCO9vA-t9nCLOM4yaQAnD_v6J_n094_w7ptFYka0eKaCLJNgkAMwumXGfw-z_kpgeGyGxvR8OZTQFGod-w=w1245-h934-s-no-gm?authuser=0',
},
{
title: 'DevFest 2023 was so much fun.',
image: 'https://lh3.googleusercontent.com/pw/AP1GczO4B4h5u6zeCSGNcPagf66c9WqM7KKohKiEDCvUivg-6PzLU7vE69Zm6GvLIRSbD0RG8Xf9C4ct1aGBLG0Bdkw3Zu7aa9nlZK_SuUjiObyPCBE0cf5xI2WlNf5mm1ZVJUFz8fDTEcLyAfSXwffXcWaU=w1401-h934-s-no-gm?authuser=0',
},
{
title: 'DevFest 2023 was so much fun.',
image: 'https://lh3.googleusercontent.com/pw/AP1GczOmd39MutMAgLaW_axHvRZe5qQBhlWIUmkEuh4QyO9yZpKxBHzquGvN0ovFcndWLqNY2RFoigWryZa-7EvH0VW72OKK4pg4VORzK1nKgWCum7WBiOdemjdzDSeYMiuVYSPewhuePJlzJW2-CQXkMfKK=w1113-h741-s-no-gm?authuser=0',
},
{
title: 'DevFest 2023 was so much fun.',
image: 'https://lh3.googleusercontent.com/pw/AP1GczPHkQXssvLefc7W9qc6z3RDUMKlIouU3fKMQgETlTHwGbJwLlcdYVpVjUyUV1oAl08FvKHEpDLw1VT7mgeQ4hGuq8F05xbpYF5jvCQ_na_WKz-G7H_viX6H6wYUkitxggNtyExAvHZxlCY3e42FE4KY=w1113-h741-s-no-gm?authuser=0',
}];
27 changes: 27 additions & 0 deletions src/lib/GoogleAnalytics.js
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;

0 comments on commit e39795a

Please sign in to comment.