Skip to content

chore: clean up analytics logging#74

Merged
condyl merged 1 commit intomasterfrom
cb/clean-up-analytics-logging-2
Jan 11, 2026
Merged

chore: clean up analytics logging#74
condyl merged 1 commit intomasterfrom
cb/clean-up-analytics-logging-2

Conversation

@condyl
Copy link
Copy Markdown
Collaborator

@condyl condyl commented Jan 11, 2026

This pull request adds Google Analytics event tracking throughout the application, but ensures that analytics are only enabled in production builds. The changes include initializing Google Analytics conditionally, sending pageview events on key pages, and tracking specific user actions (such as exporting timetables, adding courses, and handling truncation warnings). All analytics logic is gated behind a production environment check to avoid polluting analytics data during development.

Analytics Integration (Production Only):

  • Added a production environment check (isAnalyticsEnabled) to all components and utilities that interact with Google Analytics, ensuring events are only sent in production.
  • Initialized Google Analytics only when running in production, preventing unnecessary initialization during development.

Event Tracking for User Actions:

  • Added Google Analytics event tracking for exporting timetables, adding courses, and truncation warnings, all gated by the production check.

Pageview Tracking:

  • Sent pageview events to Google Analytics on the main Generator and Guide pages, but only in production.

Minor Refactoring:

  • Updated imports in GuidePage.jsx to include useEffect for analytics tracking.

@condyl condyl merged commit d9ade80 into master Jan 11, 2026
3 checks passed
@condyl condyl deleted the cb/clean-up-analytics-logging-2 branch March 16, 2026 20:47
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.

1 participant