Skip to main content
The YouTube Analytics live data source reads one YouTube channel. Each query is one report request, and Lightdash shows the results as they come back from YouTube. It’s a level 3 integration: its API returns reports.

Before you start

  • Live data sources enabled for your organization. See Live data sources.
  • Admin role in the Lightdash project.
  • A Google account that can read the channel’s analytics.

Connect YouTube Analytics

  1. On the nav bar, click Browse → Semantic Layer.
  2. In the sidebar, select Live data sources, then click Add.
  3. Select YouTube Analytics.
  4. Enter a Name, such as YouTube Analytics.
  5. Click Continue to Google.
  6. Sign in with your Google account and allow read-only access to YouTube.
  7. Back in Lightdash, pick the channel the source reads.
Lightdash adds a Channel activity table to Explore. Queries run with the Google account that signed in. To change it, choose Sign in again from the source’s menu.

Dimensions

Revenue, demographics, playlists and audience retention aren’t available.

Metrics

Combination rules

YouTube answers a fixed set of reports. A query can break down by one of these:
  • Date or Date month
  • Country
  • Video ID
  • Device type, optionally with Date
  • Traffic source type, optionally with Date
You can add Content type to any of them, but it can’t be used alone. A query with no dimensions returns channel totals. Some reports have further rules:
  • Device type and Traffic source type only work with Views, Engaged views and Estimated minutes watched.
  • Video ID returns at most 200 videos, ranked from highest to lowest. Sort by one of Views, Estimated minutes watched, Subscribers gained or Subscribers lost.
  • Date month only reads whole months. Filter Date to start on the first of a month and end on the last of a month or today.
Lightdash checks these rules before calling YouTube and tells you what to change.

Supported features

A query can’t filter by a dimension and break down by it at the same time.

Limits

YouTube leaves out the most recent days until all their metrics are ready, so the latest dates can be missing. YouTube also applies its own quotas.

Example questions

  • “Views and watch time by day over the last 28 days.”
  • “Top 20 videos by estimated minutes watched this month.”
  • “Views by traffic source type last week.”

Troubleshooting

The latest days are missing. YouTube publishes a day’s data once all its metrics are ready. Check again later, or end the date range earlier. YouTube has no report for your combination. See Combination rules and remove a dimension.