Skip to content

Add GA tracking#544

Merged
binura-g merged 2 commits intoopenchoreo:mainfrom
madhuramendis:main
Apr 6, 2026
Merged

Add GA tracking#544
binura-g merged 2 commits intoopenchoreo:mainfrom
madhuramendis:main

Conversation

@madhuramendis
Copy link
Copy Markdown
Contributor

Purpose

Briefly describe what this pull request does.

Related Issues

Include any related issues that are resolved by this PR.

Checklist

  • Updated sidebars.ts if adding a new documentation page
  • Run npm run start to preview the changes locally
  • Run npm run build to ensure the build passes without errors
  • Verified all links are working (no broken links)

madhuramendis and others added 2 commits April 3, 2026 15:02
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Madhura Mendis <madhuramendis@gmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Integrated analytics tracking to gather insights on website usage and performance, with privacy protections enabled.

Walkthrough

Added a Google Analytics (gtag) configuration block to the Docusaurus theme preset, setting the tracking ID to G-5EY968JNZT and enabling IP anonymization. No other configuration logic was modified.

Changes

Cohort / File(s) Summary
Google Analytics Configuration
docusaurus.config.ts
Added gtag configuration object under the classic preset theme options with trackingID and anonymizeIP settings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description contains only the template structure with placeholder text and an unchecked checklist, but lacks any actual content in the required Purpose and Related Issues sections. Fill in the Purpose section to explain the GA tracking implementation and specify if any related issues exist; also verify checklist items as applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add GA tracking' is concise and directly reflects the main change: adding Google Analytics tracking configuration to the Docusaurus site.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docusaurus.config.ts (1)

129-132: Environment-gate the GA tracking config.

gtag is unconditionally enabled with a hardcoded production Measurement ID. Environment-gate it to prevent analytics pollution from non-production deployments. Verify separately that consent handling is implemented (code search did not locate explicit consent patterns).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docusaurus.config.ts` around lines 129 - 132, The gtag block is
unconditionally set with a hardcoded Measurement ID; change it to only include
gtag when running in production and when an env var provides the ID. Replace the
static gtag object (trackingID: 'G-5EY968JNZT', anonymizeIP: true) with code
that reads process.env.GA_MEASUREMENT_ID (or similar) and process.env.NODE_ENV
=== 'production' and only assigns the gtag property when both conditions are met
(preserve anonymizeIP), otherwise omit or set gtag to undefined; update any
config typing to accept an optional gtag to avoid compile errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docusaurus.config.ts`:
- Around line 129-132: The gtag block is unconditionally set with a hardcoded
Measurement ID; change it to only include gtag when running in production and
when an env var provides the ID. Replace the static gtag object (trackingID:
'G-5EY968JNZT', anonymizeIP: true) with code that reads
process.env.GA_MEASUREMENT_ID (or similar) and process.env.NODE_ENV ===
'production' and only assigns the gtag property when both conditions are met
(preserve anonymizeIP), otherwise omit or set gtag to undefined; update any
config typing to accept an optional gtag to avoid compile errors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bd72c91e-1a02-4b39-a5d5-4b8b469293c9

📥 Commits

Reviewing files that changed from the base of the PR and between 5243a9d and aabbc0d.

📒 Files selected for processing (1)
  • docusaurus.config.ts

@binura-g binura-g merged commit 5225390 into openchoreo:main Apr 6, 2026
3 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