This guide explains how to configure the YouTube Analytics API as a data source in Mage. Learn how to authenticate with Google Cloud, request the necessary OAuth scopes, and sync data from specific channels.
Key | Description | Sample Value | Required |
---|---|---|---|
client_id | OAuth 2.0 Client ID from Google Cloud Console | 123456789-abcdef.apps.googleusercontent.com | ✅ |
client_secret | OAuth 2.0 Client Secret from Google Cloud Console | abcdefghijklmnopqrstuvwxyz | ✅ |
refresh_token | OAuth 2.0 refresh token for authenticating requests | 1//abcdefghijklmnopqrstuvwxyz | ✅ |
start_date | Start date for pulling analytics data | 2021-01-01T00:00:00Z | ✅ |
user_agent | User agent string identifying the integration | example@example.com | ✅ |
channel_ids | Comma-separated list of channel IDs to retrieve analytics for | UC1234..., UC5678... | ✅ |
refresh_token
:
https://www.googleapis.com/auth/youtube.readonly
https://www.googleapis.com/auth/yt-analytics.readonly
Stream | Description |
---|---|
channels | Metadata and statistics for authenticated YouTube channels |
playlist_items | Videos and items within playlists |
playlists | Metadata about playlists created by the authenticated user |
reports | Bulk analytics data from YouTube Reporting API |
videos | Video metadata, engagement, and performance statistics |