Skip to content

feat: add YouTube Analytics#13

Merged
paulocastellano merged 3 commits into
mainfrom
feature/youtube-analytics
Apr 14, 2026
Merged

feat: add YouTube Analytics#13
paulocastellano merged 3 commits into
mainfrom
feature/youtube-analytics

Conversation

@paulocastellano
Copy link
Copy Markdown
Contributor

Summary

  • Adds YouTube Analytics API v2 integration with 7 channel metrics: Views, Minutes Watched, Avg. View Duration, Avg. View Percentage, Subscribers Gained, Subscribers Lost, Likes
  • Adds yt-analytics.readonly OAuth scope to YouTube controller (existing users will need to reconnect)
  • Creates YouTubeAnalytics.php service following the same pattern as other analytics services (caching, token refresh, HasSocialHttpClient)
  • Creates YouTubeAnalytics.vue component with date range support
  • Registers YouTube in AnalyticsController supported platforms

Notes

  • Google Cloud Console: Enable "YouTube Analytics API" and add the yt-analytics.readonly scope to the OAuth consent screen
  • Existing users: Will need to reconnect their YouTube account to grant the new analytics scope

Test plan

  • 9 feature tests covering: metrics parsing, API failure, empty rows, caching, date range, token refresh, controller integration, workspace authorization
  • Manual test: connect YouTube account and verify analytics display in the UI
  • Verify date range picker works correctly with YouTube analytics

Integrates YouTube Analytics API v2 to display channel-level metrics
(views, minutes watched, avg view duration, avg view percentage,
subscribers gained/lost, likes) with date range support and caching.
- Store response JSON once instead of parsing twice
- Add tests for null refresh token and token refresh failure scenarios
@paulocastellano paulocastellano merged commit 7506167 into main Apr 14, 2026
2 checks passed
@paulocastellano paulocastellano deleted the feature/youtube-analytics branch April 14, 2026 17:00
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.

1 participant