This solution uses Google Sheets and Apps Script to create a spreadsheet tracker for performance of selected public YouTube videos. The spreadsheet reads user-provided YouTube links and uses the YouTube Advanced Service to source views, likes, and comment counts for each video. The data updates are triggered to run on a regular basis, and an email notification is sent for any videos that have increased comment counts.
More info available in this blog post.
- Make of copy of the spreadsheet here. It already contains the Apps Script code from this repository.
- Change the name of the tab to the full email address where you’d like to receive email notifications.
- Locate URLs of videos you would like to track and add them in column A below cell A1. URLs must be in the format starting with:
- From the spreadsheet, open the script editor by selecting Tools > Script editor.
- In the left-hand navigation pane, select + next to Services.
- Choose the YouTube Data API service, and click Add.
- From the script editor, choose
markVideos
from the drop-down box in the toolbar, then click ▶ Run. - You should see the details added in columns C through H, and you will receive an email for any videos that have more than zero comments. When running the function in the future, you will only receive an email with videos whose comment count has increased since the last time the script was run.
- Optionally, to turn off email notifications, change line 2 of
code.gs
from'Y'
to'N'
.
Instead of running the script manually, set it up to run at regular intervals (such as once a day).
- From the script editor, navigate to the left-hand vertical toolbar, and choose Triggers.
- In the bottom right-hand corner, click the +Add Trigger button.
- Under Run, select the
markVideos
function. - Under Select event source, choose Time-driven.
- Under type, select Day timer.
- Then select time of day, such as 6am to 7am.
- Optionally, adjust the Failure notification settings to configure how and when you are contacted by email if your triggered function fails.
- Click Save.
Let me know if you run into any problems!
NOTE: This is not an official Google product.