Skip to content

feat: Add Google Analytics#33

Merged
theamankumarsingh merged 6 commits intomainfrom
develop
Feb 24, 2026
Merged

feat: Add Google Analytics#33
theamankumarsingh merged 6 commits intomainfrom
develop

Conversation

@theamankumarsingh
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Google Analytics to the Next.js application (pages router), alongside a set of responsive UI tweaks and dependency/lockfile updates.

Changes:

  • Inject Google Analytics (gtag) scripts in pages/_app.tsx, gated by NEXT_PUBLIC_GA_ID.
  • Adjust responsive typography/padding in mission brief and landing header components.
  • Add @next/third-parties and update package-lock.json (includes broader dependency version churn).

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pages/_app.tsx Adds GA script injection using next/script and NEXT_PUBLIC_GA_ID.
package.json Adds @next/third-parties dependency.
package-lock.json Updates lockfile (Next + many transitive packages).
.env.local Adds placeholder for NEXT_PUBLIC_GA_ID.
src/components/mission-brief/MissionBriefContent.tsx Makes headings/styles responsive via Tailwind + CSS clamp().
src/components/landing/SectionCard.tsx Tweaks padding for smaller breakpoints.
src/components/landing/Header.tsx Improves responsive typography/spacing; minor copy adjustment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 24 to 28
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${gaId}');
`}
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current setup, GA will only send the initial page_view; client-side route changes in Next.js won’t be tracked automatically. Add route-change handling (e.g., listen to next/router routeChangeComplete and call gtag('config', gaId, { page_path })) so SPA navigations are recorded.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BIJJUDAMA Do we need to resolve this?

@theamankumarsingh theamankumarsingh merged commit 513a033 into main Feb 24, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants