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.
- From the spreadsheet, open the script editor by selecting Tools > Script editor.
- In the script editor, select Resources > Advanced Google services.
- In the Advanced Google Service dialog that appears, click the on/off switch next to the YouTube Data API service.
- Click OK in the dialog.
- From the script editor, choose
markVideosfrom the select box in the toolbar, then click ▶. - 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.gsfrom'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, choose Edit > Current project's triggers.
- Click the link that says: No triggers set up. Click here to add one now.
- Under Run, select the
markVideosfunction. - Under Select event source, choose Time-driven.
- Under type, select Day timer.
- Then select time of day, such as 6am to 7am.
- Optionally, click Notifications 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.