【问题标题】:AVERAGE VIEW DURATION平均观看时长
【发布时间】:2015-12-21 14:37:42
【问题描述】:

如何在 youtube api 上获得平均观看时长

【问题讨论】:

    标签: view average duration


    【解决方案1】:

    根据 YouTube 分析 API 的 Sample Application 稍作修改

    var request = gapi.client.youtubeAnalytics.reports.query({
        // The start-date and end-date parameters must be YYYY-MM-DD strings.
        'start-date': formatDateString(lastMonth),
        'end-date': formatDateString(today),
        // At this time, you need to explicitly specify channel==channelId.
        // See https://developers.google.com/youtube/analytics/v1/#ids
        ids: 'channel==' + channelId,
        dimensions: 'day',
        sort: 'day',
        // See https://developers.google.com/youtube/analytics/v1/available_reports
        // for details about the different filters and metrics you can request
        // if the "dimensions" parameter value is "day".
        metrics: 'averageViewDuration',
        filters: 'video==' + videoId
      });
    

    当然,这假设您已经完成了验证和检索 videoid 的工作。

    【讨论】:

      猜你喜欢
      • 2018-01-04
      • 2019-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多