Connect YouTube to Rig
Sync your YouTube channel, playlists, videos and comments into Rig, together with daily channel and video metrics, traffic sources and audience demographics. YouTube Analytics only answers to the channel owner, so you paste a Google OAuth client ID and secret plus a refresh token that the owner has approved.
Before you start
- You need to be the owner of the channel (for a brand channel, the account that owns the brand account). YouTube Analytics reports can only be read with the channel owner's authorisation, and service accounts are not supported.
- You need a Google Cloud project where you can create credentials, with the YouTube Data API v3 and the YouTube Analytics API enabled on it.
- Plan to approve two scopes when you create the refresh token:
youtube.readonlyandyt-analytics.readonly. Rig only reads data and never changes your channel.
Step 1: Create a Google OAuth client
Google describes where credentials live in its guide to obtaining authorisation credentials for the YouTube APIs.
- Open the Google Cloud console and pick the project you want to use, or create one.
- Enable the YouTube Data API v3 and the YouTube Analytics API for that project.
- Open the Credentials page of the API Console and create an OAuth client ID.
- Copy the client ID and client secret. You paste both into Rig later.
Step 2: Create a refresh token as the channel owner
Rig needs a long-lived refresh token so it can sync without you signing in each night.
- Run Google's OAuth consent flow with your client, requesting the
youtube.readonlyandyt-analytics.readonlyscopes and offline access so Google returns a refresh token. - Sign in as the channel owner. On Google's account picker, choose the brand channel you want to sync, so the token resolves to that channel and not to your personal account.
- Copy the refresh token that Google returns. If your consent screen is still in Testing, Google expires the token after seven days, so set the publishing status to In production first. Google can also revoke a token, for example if the channel owner removes access, and then you need to create a new one.
Keep the token private
The refresh token gives read access to your channel analytics. Store it somewhere safe until you have pasted it into Rig.
Step 3: Connect it in Rig
Adding a source needs a workspace owner, or a role with the Manage connections permission, on a workspace where you manage your own connections. If the Connectors tab says “Data ingestion for this workspace is managed by Rig”, ask an owner or Rig support to add the source.
- In Rig, open
Connections, choose theConnectorstab and go toSources & actions. - Search for YouTube, open the card and click
Connect. - OAuth client ID: paste the client ID from your Google Cloud project.
- OAuth client secret: paste the matching client secret.
- OAuth refresh token: paste the refresh token you created as the channel owner.
- Channel ID (usually leave blank): leave it blank. Rig detects the authorised channel. Fill it in with a
UCchannel ID only to pin the catalogue to a specific channel the token can read. - Click
Continue. Rig checks the credentials and lists the streams it can reach, so choose the ones you want and clickConnect. - The source then syncs on its schedule, which is nightly unless you change it. To load data straight away, click
Syncon its row;Testpulls a small sample first if you want to check the connection.
What Rig pulls in
YouTube lands in its own youtube schema in your warehouse:
- Catalogue: channels, playlists, playlist items, videos and comment threads.
- Daily metrics: daily channel metrics and daily per-video metrics.
- Audience and traffic: daily traffic sources and demographics.
Comments come from videos that have them switched on. Videos with comments disabled are skipped, and each comment thread carries at most five replies.
Good to know
- YouTube Analytics data arrives about two days late, so the most recent days fill in on later syncs.
- The Data API gives each Google Cloud project 10,000 quota units a day. Rig walks your uploads playlist, which costs one unit per 50 videos, so even large channels stay far below that.
- YouTube Analytics always reports the authorised channel. To sync a second channel, add another YouTube connection with a refresh token for that channel.
- To disconnect YouTube, click the bin icon on the source's row under
Sources & actions. Only whoever connected the source or a workspace owner can do this, and data already synced stays in the warehouse.
What people use this for
- See which videos earn attention over time
- Read traffic sources properly
- Line video up against the rest of marketing