Skip to main content
GET
Get User Analytics

Authentication

This endpoint requires authentication via Clerk. The userId is automatically extracted from the authentication token.

Response

boolean
required
Indicates whether the request was successful
object
Analytics data object
string
Error message if success is false

Response Example

Error Codes

Analytics Calculation Details

Page Filtering

The following pages are excluded from analytics calculations:
  • Home
  • Browse Courses
  • Course Details
  • Analytics
  • Other

Course Learning Time

Tracked from sessions where the path starts with /player/:courseId

Quiz Time

Tracked from sessions where the path starts with /quiz/:courseId/:chapterId

Daily Statistics

Provides a 7-day rolling window with data for each day, even if duration is 0

Sorting

  • pageStats: Sorted by totalDuration (descending)
  • courseBreakdown: Sorted by total time (learning + quiz duration, descending)
  • chapters: Sorted by quizDuration (descending)

Use Cases

  • Display user’s learning dashboard
  • Track study habits and patterns
  • Identify most engaged courses
  • Generate progress reports
  • Visualize daily learning trends
  • Show chapter-level quiz performance