The StudyFetch Usage Tracking API provides comprehensive analytics and monitoring capabilities to track user activity, measure engagement, and analyze usage patterns across your organization.

Understanding User ID and Group ID

User ID is a unique identifier for each user that comes from your platform. StudyFetch accepts any user ID format that your system uses, allowing seamless integration with your existing user management system. This flexibility enables:
  • Platform Integration: Use your existing user IDs without modification - whether they’re UUIDs, email addresses, student IDs, or any other format
  • Individual Activity Tracking: Monitor specific user interactions with materials, components, and features
  • Personalized Analytics: Generate user-specific reports on study patterns, performance, and engagement
  • Progress Monitoring: Track individual learning progress across different materials and assessments
  • Usage Attribution: Link specific events and actions to individual users for detailed analysis
Important: StudyFetch doesn’t generate user IDs - it uses whatever user identifiers your platform provides, ensuring consistency across your systems. Group ID represents an organizational unit such as a class, school, district, or any custom grouping. This ID allows:
  • Aggregate Analytics: View combined usage statistics for all users within a group
  • Organizational Reporting: Generate reports at the class, school, or district level
  • Performance Comparison: Compare usage patterns and outcomes across different groups
  • Resource Allocation: Understand how different groups utilize StudyFetch features to optimize resource distribution

Usage Event Types

The API tracks various event types to provide comprehensive insights:

Material Events

  • material_created - When new study material is created
  • material_uploaded - When files are uploaded to the platform
  • material_processed - When materials are processed by AI
  • material_deleted - When materials are removed

Component Events

  • component_created - When study components (flashcards, tests, etc.) are generated
  • component_accessed - When users view or interact with components
  • component_deleted - When components are removed
  • component_usage - General component interaction events

Chat & Communication Events

  • chat_message_sent - When users send messages in AI chat
  • chat_session_started - When new chat sessions begin
  • chat_session_ended - When chat sessions conclude

Assessment Events

  • test_created - When practice tests are generated
  • test_started - When users begin assessments
  • test_completed - When tests are finished
  • test_question_answered - Individual question responses
  • test_retaken - When users retake assessments

Feature Usage Events

  • audio_recap_create - Audio summary generation
  • assignment_grader_create - Assignment grading events
  • student_performance - Performance tracking events

System Events

  • api_call - API endpoint usage
  • cache_hit - Cached response usage
  • sso_login - Single sign-on authentication
  • sso_logout - User logout events

Example Usage

import StudyfetchSDK from '@studyfetch/sdk';

const client = new StudyfetchSDK({
  apiKey: 'your-api-key',
  baseURL: 'https://studyfetchapi.com',
});

// Track individual user progress
const userEvents = await client.v1.usage.listEvents({
  userId: 'john.doe@school.edu',
  eventType: 'test_completed',
  startDate: '2024-01-01T00:00:00Z',
  endDate: '2024-12-31T23:59:59Z',
  limit: 100,
  offset: 0
});

// Generate monthly group summary
const groupSummary = await client.v1.usage.getSummary({
  period: 'monthly',
  startDate: '2024-01-01T00:00:00Z',
  endDate: '2024-12-31T23:59:59Z',
  groupBy: 'group'
});

// Monitor feature adoption
const featureUsage = await client.v1.usage.listEvents({
  eventType: 'audio_recap_create',
  limit: 1000,
  groupId: 'class-101'
});

// Get usage statistics
const stats = await client.v1.usage.getStats({
  startDate: '2024-01-01T00:00:00Z',
  endDate: '2024-12-31T23:59:59Z',
  userId: 'john.doe@school.edu'
});