Manish Verma
Manish Verma

Reputation: 25

how to show gender dimension count of a specific video in youtube analytics API?

I am using youtube analytics api v1 to retrieve the videos details from youtube. I want to get gender dimension count but couldn't find relevant answer. However, I have succeeded to create a GET url to get other details like elapsedVideoTimeRatio, audienceWatchRatio, relativeRetentionPerformance of a given video id. Please take a look at below URL.

https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel=={ABC_CHANNEL}&start-date=2018-01-04&end-date=2018-04-16&metrics=audienceWatchRatio,relativeRetentionPerformance&dimensions=elapsedVideoTimeRatio&filters=video=={ABCXYZ}&fields=columnHeaders,kind,rows&access_token={ACCESS_TOKEN}

This URL gives me the details of mentioned parameters with no error. But whenever i try to change the metrics or dimensions parameters it gives me error. I want to know how to get analytics data of a particular video with ageGroup, gender dimension.

I am trying to make the GET request using below URL by changing the metrics and dimensions params.

https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel==UCiqK9TkrbgO_i7h-XGExMXQ&start-date=2018-01-04&end-date=2018-04-16&metrics=viewerPercentage&dimensions=ageGroup,gender&filters=video==rUV78kBqdEs;audienceType==ORGANIC&fields=columnHeaders,kind,rows&access_token=ya29.GlufBf1Dc3u6TRsxYFLrSwQS08CcSB0_Dpxt4AbcWNSbMCaEG11jgdwubKxzXA2DsglpmQucmDdDi-k_VxFYljoga8r69-vj5G_i_O3GD0f_T9QHyZcAjG0ssbj5

The above url gives the error response as given below.

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "badRequest",
    "message": "The query is not supported. Check the documentation at 
https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
   }
  ],
  "code": 400,
  "message": "The query is not supported. Check the documentation at 
https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
 }
}`

Please help.

Upvotes: 2

Views: 999

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116868

You are sending filters=video==rUV78kBqdEs;audienceType==ORGANIC as per the documentation you can only send the following filters.

Filters:

  • Use 0 or 1 country, province, continent, subContinent
  • Use 0 or 1 video, group
  • Use 0 or more liveOrOnDemand, subscribedStatus

Upvotes: 1

Related Questions