Skip to content

Analytics with PostHog

Course Pipeline uses PostHog to track user interactions, providing valuable insights into how your application is being used.

Automatic Event Tracking

The following events are tracked automatically:

  • Page Views - All page navigation in the application
  • Page Leave - When users exit pages
  • Clicks - Element interactions (buttons, links, etc.)
  • Form Submissions - When forms are submitted
  • User Authentication - Login/logout events
  • Course Interactions - Course loads, completions, and variable changes

Custom Events

You can track custom events in your components using the usePostHog composable:

js
import { usePostHog } from '@/composables/usePostHog';

// In your component setup
const { trackEvent } = usePostHog();

// Track a custom event
function handleImportantAction() {
  trackEvent('important_action_performed', {
    // Add any properties relevant to the event
    item_id: item.id,
    action_type: 'specific_action'
  });
}

User Identification

PostHog automatically identifies users when they log in. The following properties are captured:

  • User ID
  • Email
  • Name
  • Organization information
  • Role

Consider tracking these events in your components:

  • Feature Usage - When specific features are used
  • Error Occurrences - When errors happen during user workflows
  • Conversion Points - When users complete important business actions
  • Content Engagement - When users interact with specific content
  • Custom Preferences - When users set or change preferences

Privacy Considerations

  • PostHog is configured to exclude sensitive information like passwords
  • User data is anonymized for analytics purposes
  • Users can opt out of tracking (implement with posthog.opt_out())

Dashboard Access

Access your PostHog analytics dashboard at: https://app.posthog.com/

Backend Event Tracking

The server tracks important operations like:

  • API usage
  • Course uploads and processing
  • Learner data submissions
  • Report generation
  • Error rates and types