Skip to content

Conversation

@jp-ayyappan
Copy link
Contributor

@jp-ayyappan jp-ayyappan commented Jan 21, 2026

Summary

Adds Google Analytics tracking to the OpenTDF documentation site with full GDPR/CCPA compliance through:

  • Opt-in cookie consent banner
  • Privacy Policy, Cookie Policy, and Terms of Service pages (leveraging Virtru's legal language)
  • Legal section in footer

Changes

  • ✅ Cookie consent banner using react-cookie-consent
    • Only loads Google Analytics after user accepts cookies
    • Decline option available
    • Preference saved for 365 days
  • ✅ IP anonymization enabled for GDPR compliance
  • ✅ Privacy Policy page (/privacy-policy)
  • ✅ Cookie Policy page (/cookie-policy)
  • ✅ Terms of Service page (/terms-of-service)
  • ✅ Legal footer section with links to all policy pages
  • ✅ Fix: Getting Started page title in sidebar (was showing "index")

Privacy & Legal Compliance

  • GDPR Compliant: Opt-in consent, IP anonymization, user rights documented
  • CCPA Compliant: Privacy policy includes California resident rights
  • No Personal Data Sales: Explicit commitment in policies
  • Contact Information: Uses Virtru contact details (privacy@virtru.com)

Testing

  • ✅ Build succeeds locally
  • ✅ Cookie banner appears on first visit
  • ✅ Analytics only loads after acceptance
  • ✅ All policy pages render correctly
  • ✅ Footer links work
  • ✅ No broken links or build warnings

Screenshots

The cookie consent banner appears at the bottom of all pages with Accept/Decline options and links to privacy policies.


🤖 Generated with Claude Code

- Add cookie consent banner (opt-in) using react-cookie-consent
- Google Analytics only loads after user accepts cookies
- Add Privacy Policy, Cookie Policy, and Terms of Service pages
- Add Legal section to footer with policy links
- Enable IP anonymization for GDPR compliance
- Fix Getting Started page title in sidebar

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jp-ayyappan jp-ayyappan requested review from a team as code owners January 21, 2026 19:29
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jp-ayyappan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the OpenTDF documentation site by integrating Google Analytics in a privacy-conscious manner. It ensures compliance with major data protection regulations like GDPR and CCPA by requiring explicit user consent for tracking, anonymizing IP addresses, and providing detailed legal documentation. The changes also improve site navigation by correctly labeling a key documentation page.

Highlights

  • Google Analytics Integration: Implemented Google Analytics tracking on the OpenTDF documentation site.
  • Privacy-Compliant Cookie Consent: Added an opt-in cookie consent banner using 'react-cookie-consent' to ensure GDPR/CCPA compliance, loading analytics only upon user acceptance and enabling IP anonymization.
  • Comprehensive Legal Pages: Introduced dedicated pages for Privacy Policy, Cookie Policy, and Terms of Service, leveraging Virtru's legal language.
  • Footer Legal Section: Updated the site footer to include a 'Legal' section with direct links to the newly added policy pages.
  • Sidebar Title Correction: Fixed an issue where the 'Getting Started' page title was incorrectly displayed as 'index' in the sidebar.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds Google Analytics tracking with a privacy-compliant cookie consent banner, along with the necessary legal pages. The implementation is well-structured, particularly the conditional loading of analytics scripts based on user consent. I've provided a couple of suggestions for the new src/theme/Root.tsx component to improve maintainability by centralizing configuration and separating styles from logic. The other changes look good.

jp-ayyappan added a commit that referenced this pull request Jan 21, 2026
Address PR review feedback:
- Move Google Analytics tracking ID to docusaurus.config.ts customFields
- Use useDocusaurusContext hook to access config in Root.tsx
- Move cookie consent inline styles to src/css/custom.css
- Use CSS classes with Docusaurus theme variables for consistency
- Add hover states for improved UX

Addresses comments from PR #174

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Address PR review feedback:
- Move Google Analytics tracking ID to docusaurus.config.ts customFields
- Use useDocusaurusContext hook to access config in Root.tsx
- Move cookie consent inline styles to src/css/custom.css
- Use CSS classes with Docusaurus theme variables for consistency
- Add hover states for improved UX

Addresses comments from PR #174

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jp-ayyappan jp-ayyappan enabled auto-merge (squash) January 21, 2026 19:57
jp-ayyappan and others added 3 commits January 21, 2026 15:25
Fix issue where Google Analytics only loaded on first cookie acceptance
but not on subsequent page visits.

Changes:
- Extract GA initialization into separate function
- Add useEffect to check for existing cookie consent on mount
- Initialize GA automatically if user previously accepted cookies
- Add guard to prevent duplicate GA script loading

This ensures analytics tracking works consistently across all page
visits after initial consent, not just the first acceptance.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add route change tracking for Single Page Application navigation.
Previously, only the initial page load was tracked, but subsequent
client-side navigation within the docs was not captured.

Changes:
- Import useLocation from @docusaurus/router
- Add useEffect that listens to location changes
- Send page_path to GA on every route change
- Include pathname, search params, and hash in tracking
- Maintain IP anonymization on all page views

This ensures comprehensive analytics tracking across all pages
in the documentation site, not just the landing page.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Contributor

@eugenioenko eugenioenko left a comment

Choose a reason for hiding this comment

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

🚢

@jp-ayyappan jp-ayyappan merged commit a087d3b into main Jan 21, 2026
4 checks passed
@jp-ayyappan jp-ayyappan deleted the add-google-analytics branch January 21, 2026 21:08
jp-ayyappan added a commit that referenced this pull request Jan 22, 2026
Address PR review feedback:
- Move Google Analytics tracking ID to docusaurus.config.ts customFields
- Use useDocusaurusContext hook to access config in Root.tsx
- Move cookie consent inline styles to src/css/custom.css
- Use CSS classes with Docusaurus theme variables for consistency
- Add hover states for improved UX

Addresses comments from PR #174

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

4 participants