The Youtube Analytics API supports many different report types. You can see them in the official documentation here. This tutorial will show you how to use the Traffic sources report to extract details about which channels send how much traffic to each of your videos.
This is a two-step process. First, we’ll get a list of video IDs. Then we’ll ask for analytics on those video IDs.
Get a list of video IDs
In order to request traffic sources by video ID, we first need a list of video IDs. We’ll use the YouTube /search endpoint to find our videos. Use the form below to get your IDs.
Get your YouTube video IDs
Please fill in any necessary fields and click Run.
GET
Preview
View the API data, get a live Google Sheet dashboard
ID | Title | Channel | Published At |
---|---|---|---|
Get a live Google Sheet
Export your data to a google sheet, with the SyncWith Addon, or download to CSV
Automatically updated
Schedule your data to update hourly or daily
Add data sources
Import additional data from other apps
Build reports & dashboards
Easily build live reports within Google Sheets
Make a note of a a video ID that you’d like to drill in to.
You can drill into multiple video IDs, just join them with a comma. For example: ID-1,ID-2,ID-3
Get traffic source details
Using the video IDs from the previous step, we’ll call the YouTube Analytics /reports endpoint. We’ll specify that we want a traffic sources report by requesting the
insightTrafficSourceType
dimension.This will return traffic sources with types like: ADVERTISING, ANNOTATION, CAMPAIGN_CARD, END_SCREEN, EXT_URL, NO_LINK_EMBEDDED, NO_LINK_OTHER, NOTIFICATION, PLAYLIST, PROMOTED, RELATED_VIDEO, SHORTS, SUBSCRIBER, YT_CHANNEL, YT_OTHER_PAGE, YT_PLAYLIST_PAGE, YT_SEARCH. To get the exact definition of what each type is, please refer to the YouTube documentation.
Note that this report only supports a subset of dimensions and metrics — refer to the official documentation for more details.
Update the
filters
parameter in the form below to use your video IDs. To get data on two videos, it should read video==your-ID-1,your-ID-2
Get Details by Traffic Source
Please fill in any necessary fields and click Run.
GET
Preview
View the API data, get a live Google Sheet dashboard
Traffic Source | Video ID | Views | Minutes Watched |
---|---|---|---|
Get a live Google Sheet
Export your data to a google sheet, with the SyncWith Addon, or download to CSV
Automatically updated
Schedule your data to update hourly or daily
Add data sources
Import additional data from other apps
Build reports & dashboards
Easily build live reports within Google Sheets
More YouTube Tutorials
- Creating dashboards and analytic youtube
- Creating youtube dashboards
- Get your youtube channel id
- Tracking sub count youtube with Google Sheets
- Youtube music export playlist