Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR integrates PostHog analytics into the application to track user behavior and application usage. The integration includes both client-side JavaScript tracking and server-side Ruby event capture.
Changes:
- Added PostHog Ruby gem and client-side JavaScript integration for analytics tracking
- Implemented PosthogService with methods for capturing events and identifying users
- Added analytics tracking for key user actions: signups, sign-ins, settings updates, API key rotation, onboarding flow, and heartbeat submissions
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| Gemfile | Added posthog-ruby gem dependency |
| Gemfile.lock | Locked posthog-ruby version 3.4.0 with concurrent-ruby dependency |
| .env.example | Added PostHog configuration environment variables (API key and host) |
| config/initializers/posthog.rb | Initializes PostHog client with configuration and error handling |
| app/services/posthog_service.rb | Service class providing capture, identify, and capture_once_per_day methods for analytics tracking |
| app/views/layouts/application.html.erb | Embedded PostHog JavaScript snippet for client-side tracking with user identification |
| app/models/user.rb | Added analytics tracking for new user signups |
| app/controllers/users_controller.rb | Added tracking for settings updates, API key rotation, and onboarding steps |
| app/controllers/sessions_controller.rb | Added tracking for sign-ins (HCA, Slack, email), GitHub linking, and sign-outs |
| app/controllers/api/hackatime/v1/hackatime_controller.rb | Added daily tracking for heartbeat submissions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
3kh0
previously approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(For analytics!)