How to Track YouTube Videos View Count in Google Sheets

0 Comments
Editor Ratings:
User Ratings:
[Total: 0   Average: 0/5]




This tutorial explains how to track YouTube videos view count in Google Sheets. Here I will mention two simple methods to do that easily. In this post, I will talk about a simple script and a Google Sheet add-on to fetch publicly available information about a YouTube video though its ID. And not only views, but you can also see some other stats as well such as likes, dislikes, duration, thumbnail, etc.

If you have a YouTube channel and wants to keep track of views you get on all videos, then the best way to do that from Google Sheets. Even though, you can do the same thing using YouTube Analytics but, in case you use Google sheets more often then the methods I have mentioned here will be much handier.

How to Track YouTube Videos View Count in Google Sheets

How to Track YouTube Videos View Count in Google Sheets?

YT Tracker:

YT Tracker is a free Google Sheets add-on to create a YouTube tracker sheet with public details of the video. It takes YouTube video ID as an input and fetch number of views it has instantly. Not only this, but it also fetches other additional information about the video such as number of likes, dislikes, published date, thumbnail, and duration. The add-on is completely free, and you can fetch and track all the aforeme4ntioned data about any YouTube video instantly.

The video data it fetches for you will always stay updated when you open the sheet. You can even share the sheet with anyone you like. Also, apart from fetching information about a random YouTube videos, you can use this add-on to fetch stats of videos in your own YouTube account.

Here are the steps to get started with this GSheet add-on to track YouTube videos.

  1. Go to the Google Workspace Marketplace here and then install this add-on. Authorize your Google account and let it access our YouTube data.
  2.  Now, you can find this in the Add-ons menu of your Google Sheets.
  3. Open a new Google Sheet. Use Add-ons > YT Tracker: YouTube Stats & Analytics > Track YouTube Videos option to create a YouTube tracker template in the sheet.
    YT Tracker Addon Menu
  4. Now, it is all ready to work. You just enter the YouTube video IDs in the first column. You can enter as many IDs you want in each row of the first column, and it will immediately fetch you details of the video instantly.
    YT Tracker in action

In this way, you can use this simple Google Sheets add-on to track how many people watch your YouTube videos. Apart from video views, other parameters will also be kept updated and there are some other options in the add-on that you’d like to use. This add-on can also show some other statistics about the YouTube videos, but you will have toe enable from the add-ons configuration page.

Track YouTube Watch Count using a Google Apps Script:

The add-on, I have mentioned above, works fine and will be enough for your needs. But if you only want watch count and as a formula that you can use in any sheet and anywhere, then you can use the following script to do that. Google Apps Script comes with support of YouTube API and can be used as follows.

  1. Go to Tools > Scripts. Paste in the code below and save.
    function onOpenFunc() {
    PropertiesService.getScriptProperties().setProperty("accessToken", ScriptApp.getOAuthToken());
    }
    /**
    * Gets the YouTube video view count using Video Id.
    *
    * @param {string} videoid The video id.
    * @return View count
    * @customfunction
    */
    function getVideoViews(videoid) {
    var accessToken = PropertiesService.getScriptProperties().getProperty('accessToken');
    
    var videoStats = YouTube.Videos.list('statistics', {'id':videoid, 'access_token':accessToken}).items[0].statistics;
    return [[videoStats.viewCount]]
    } Code in script editor
  2. Go “Services” and find YouTube Data API v3 and turn on and close popup.Enable YouTube API GSheet
  3. Click on project’s Triggers From the bottom right, click Add Trigger and set it up like this and click save. After you save the trigger, it will ask you to authorize your Google account, so do that and let it access your YouTube account. After that, go back to the Spreadsheet and refresh the browser tab.
    Add Trigger to App Script project
  4. Use formula getVideoViews() with YouTube video id in parentheses in any cell of the Google Sheet. For example, consider the video: https://www.youtube.com/watch?v=2Ws_5-hiqao you would use the function as: getVideoViews(“2Ws_5-hiqao”)
    App Script Getting YouTube Video Views in Action

This is another handy method to get the watch count of any YouTube video. Just use the script and let it work on its own. Just like the add-on I mentioned earlier, it will also make sure that view count stays updated in the sheet.

Closing thoughts:

If you are owner of some YouTube channel and want to keep track of the views you get on your videos, then you are at the right place. I have mentioned 2 very simple methods to do it and whichever you find easier, you can go with that. Both these methods are great and will give you an always updated sheet containing number of views non videos from your YouTube channel or any other channel.

Editor Ratings:
User Ratings:
[Total: 0   Average: 0/5]

Get 100 GB FREE

Provide details to get this offer