No audience retention data but columnHeaders from YouTube Analytics API

时光总嘲笑我的痴心妄想 提交于 2019-12-11 01:43:36

问题


I am unable to get any data from the sample request at https://developers.google.com/youtube/analytics/sample-requests#channel-audience-retention-reports

What am I doing wrong - I am following the sample in the API Explorer https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?metrics=audienceWatchRatio%252CrelativeRetentionPerformance&dimensions=elapsedVideoTimeRatio&filters=video%253D%253DMY_VIDEO_ID%253BaudienceType%253D%253DORGANIC&start-date=2014-05-01&end-date=2014-06-30&&ids=channel%253D%253DMY_CHANNEL_ID, requesting on my channel and filtering on a specific video. I do get a succesful response, but it is essentially only the columnHeaders:

{
 "kind": "youtubeAnalytics#resultTable",
 "columnHeaders": [
  {
   "name": "elapsedVideoTimeRatio",
   "columnType": "DIMENSION",
   "dataType": "FLOAT"
  },
  {
   "name": "audienceWatchRatio",
   "columnType": "METRIC",
   "dataType": "FLOAT"
  },
  {
   "name": "relativeRetentionPerformance",
   "columnType": "METRIC",
   "dataType": "FLOAT"
  }
 ]
}

回答1:


Try this.

It is assumed that you already provided your channelID in the link you've provided since you were able to fetch ColumnHeaders results.

You might have missed this:

  1. Provide the videoID of your uploaded video in the filters text field. For example J78o42MAQhc.
  2. Change the start date to the actual date you uploaded the video.

Then Authenticate and Execute.

Here's what I got.

200

- Show headers -

{
"kind": "youtubeAnalytics#resultTable",
"columnHeaders": [
{
"name": "elapsedVideoTimeRatio",
"columnType": "DIMENSION",
"dataType": "FLOAT"
},
{
"name": "audienceWatchRatio",
"columnType": "METRIC",
"dataType": "FLOAT"
},
{
"name": "relativeRetentionPerformance",
"columnType": "METRIC",
"dataType": "FLOAT"
}
],
"rows": [
[
0.01,
1,
0.2780657051338946
],
[
0.02,
0.821917808219178,
0.22789225435683402
],
[
0.03,
0.7123287671232876,
0.1979482394027498
],
[
0.04,
0.5753424657534246,
0.19664082667236166
],
[
0.05,
0.4931506849315068,
0.21083662779019507
]
(more results)
...


来源:https://stackoverflow.com/questions/37171463/no-audience-retention-data-but-columnheaders-from-youtube-analytics-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!