youtubeyoutube-apiyoutube-analytics-api

No audience retention data but columnHeaders from YouTube Analytics API


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"
  }
 ]
}

Solution

  • 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)
    ...