We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afa0953 commit f79f2d2Copy full SHA for f79f2d2
advanced/youtubeAnalytics.gs
@@ -34,18 +34,16 @@ function createReport() {
34
'views',
35
'estimatedMinutesWatched',
36
'averageViewDuration',
37
- 'averageViewPercentage',
38
'subscribersGained'
39
];
40
- var options = {
+ var result = YouTubeAnalytics.Reports.query({
+ ids: 'channel==' + channelId,
41
+ startDate: formatDateString(lastMonth),
42
+ endDate: formatDateString(today),
43
+ metrics: metrics.join(','),
44
dimensions: 'day',
45
sort: 'day'
- };
- var result = YouTubeAnalytics.Reports.query('channel==' + channelId,
- formatDateString(lastMonth),
46
- formatDateString(today),
47
- metrics.join(','),
48
- options);
+ });
49
50
if (result.rows) {
51
var spreadsheet = SpreadsheetApp.create('YouTube Analytics Report');
0 commit comments