---
title: "Connect YouTube to Rig — Rig guide"
description: "Connect YouTube to Rig with a Google OAuth client and a refresh token, and sync videos, comments, daily metrics, traffic sources and demographics."
canonical: "https://rig.so/guides/connect-youtube"
format: markdown
---

Search guides, references, playbooks…⌘K

Browse guides

# 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.readonly` and `yt-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.

1. Open the Google Cloud console and pick the project you want to use, or create one.
2. Enable the **YouTube Data API v3** and the **YouTube Analytics API** for that project.
3. Open the **Credentials** page of the API Console and create an OAuth client ID.
4. 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.

1. Run Google's OAuth consent flow with your client, requesting the `youtube.readonly` and `yt-analytics.readonly` scopes and offline access so Google returns a refresh token.
2. 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.
3. 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

New to Rig? Watch how to find Connections

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.

1. In Rig, open `Connections`, choose the `Connectors` tab and go to `Sources & actions`.
2. Search for **YouTube**, open the card and click `Connect`.
3. **OAuth client ID**: paste the client ID from your Google Cloud project.
4. **OAuth client secret**: paste the matching client secret.
5. **OAuth refresh token**: paste the refresh token you created as the channel owner.
6. **Channel ID (usually leave blank)**: leave it blank. Rig detects the authorised channel. Fill it in with a `UC` channel ID only to pin the catalogue to a specific channel the token can read.
7. Click `Continue`. Rig checks the credentials and lists the streams it can reach, so choose the ones you want and click `Connect`.
8. The source then syncs on its schedule, which is nightly unless you change it. To load data straight away, click `Sync` on its row; `Test` pulls 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

[More ideas for using YouTube](https://rig.so/integrations/youtube)

## YouTube documentation

- [Obtain authorisation credentials for the YouTube APIs](https://developers.google.com/youtube/reporting/guides/registering_an_application)

Was this guide helpful?

Yes No

---

- [This page as HTML](https://rig.so/guides/connect-youtube)
- [Site map for language models](https://rig.so/llms.txt)
- [API and agent documentation](https://rig.so/developers)
