Skip to content

Conversation

@area73
Copy link
Collaborator

@area73 area73 commented Jan 6, 2026

Summary by CodeRabbit

  • New Features

    • Added Google Analytics 4 integration with privacy-focused default settings.
  • Chores

    • Removed Google Tag Manager integration across the application.

✏️ Tip: You can customize this high-level summary in your review settings.

@cursor
Copy link

cursor bot commented Jan 6, 2026

PR Summary

Migrates site analytics to GA4 with a lightweight, non-blocking implementation.

  • Adds GoogleAnalytics.astro to load GA4 asynchronously when PUBLIC_GA_MEASUREMENT_ID is set; injected via BaseHead.astro
  • Removes GTM scripts/noscripts from BlogLayout.astro, BlogPost.astro, [lang]/blog/[...slug].astro, and public/rss/styles.xsl
  • Introduces src/types/astro-env.d.ts to type PUBLIC_GA_MEASUREMENT_ID

Written by Cursor Bugbot for commit e406eb7. This will update automatically on new commits. Configure here.

@area73 area73 merged commit 07e5446 into master Jan 6, 2026
2 of 9 checks passed
@area73 area73 deleted the gtm-to-analytics branch January 6, 2026 12:40
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The changes migrate tracking infrastructure from Google Tag Manager (GTM) to Google Analytics 4 (GA4). GTM references are removed from RSS stylesheet and multiple layout/page files, while a new non-blocking GA4 component is introduced and integrated into the base head template. Type definitions are added to support GA measurement ID configuration.

Changes

Cohort / File(s) Summary
GTM Removal
public/rss/styles.xsl, src/layouts/BlogLayout.astro, src/layouts/BlogPost.astro, src/pages/[lang]/blog/[...slug].astro
Deleted GTM script tags (head) and noscript iframe fallbacks (body) across RSS stylesheet and layout/page components; no replacement logic added
GA4 Integration
src/components/GoogleAnalytics.astro, src/components/BaseHead.astro
New GoogleAnalytics component loads GA4 asynchronously with low fetchpriority when PUBLIC_GA_MEASUREMENT_ID env var is configured; component is imported and rendered in BaseHead
Environment Type Definitions
src/types/astro-env.d.ts
New TypeScript ambient declaration file defining ImportMetaEnv and ImportMeta interfaces to expose PUBLIC_GA_MEASUREMENT_ID as optional string

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Out with the GTM, in with GA4's grace,
No more heavyweight trackers cluttering the place,
Async and nimble, the analytics flow,
Non-blocking and light—let the web pages glow! ✨

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 362f107 and e406eb7.

📒 Files selected for processing (7)
  • public/rss/styles.xsl
  • src/components/BaseHead.astro
  • src/components/GoogleAnalytics.astro
  • src/layouts/BlogLayout.astro
  • src/layouts/BlogPost.astro
  • src/pages/[lang]/blog/[...slug].astro
  • src/types/astro-env.d.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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