Skip to content

Add PostHog#906

Open
skyfallwastaken wants to merge 5 commits intomainfrom
posthog
Open

Add PostHog#906
skyfallwastaken wants to merge 5 commits intomainfrom
posthog

Conversation

@skyfallwastaken
Copy link
Member

(For analytics!)

Copilot AI review requested due to automatic review settings February 5, 2026 11:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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>
@skyfallwastaken skyfallwastaken requested a review from 3kh0 February 5, 2026 12:15
3kh0
3kh0 previously approved these changes Feb 5, 2026
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.

2 participants