Skip to content

Analytics heatmaps and segment engagement #215

Open

Description

@filthyrake

Summary

Add detailed analytics showing which parts of videos are watched, skipped, or rewatched.

Current State

Analytics track total views, watch time, and completion rates. No granular segment-level data.

Proposed Features

Engagement Heatmap

  • Visual heatmap showing viewer engagement across video timeline
  • Identify popular segments (high rewatch)
  • Identify drop-off points (where viewers leave)
  • Identify skipped sections

Data Collection

  • Track segment views (e.g., 10-second buckets)
  • Track seek events (skip forward/backward)
  • Track pause/resume patterns
  • Aggregate data for privacy (no per-user tracking)

Visualization

  • Heatmap overlay on video timeline in admin
  • Per-video engagement report
  • Comparative analysis across videos

Database Schema

CREATE TABLE segment_analytics (
  video_id TEXT REFERENCES videos(id),
  segment_start REAL,  -- seconds
  segment_end REAL,
  view_count INTEGER DEFAULT 0,
  rewatch_count INTEGER DEFAULT 0,
  skip_count INTEGER DEFAULT 0,
  updated_at TIMESTAMP,
  PRIMARY KEY (video_id, segment_start)
);

API Endpoints

GET /admin/videos/{id}/heatmap
POST /api/analytics/segment  # Record segment view (batched)

Client-Side Integration

  • Batch segment tracking to reduce API calls
  • 10-second segment granularity
  • Send on pause, seek, and periodically

Use Cases

  • Content creators: Understand what content resonates
  • Educators: Identify confusing sections needing revision
  • Marketers: Optimize video length and pacing

Priority

Lower - advanced analytics feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions