我试图通过使用他们的 API 来获得通过他们的 UI 看到的相同报告。
当我指定以下指标和维度时,查询不起作用:
- 指标 - 观看次数、viewerPercentage、estimatedMinutesWatched、averageViewDuration、averageViewPercentage
- 维度——insightTrafficSourceType
但是,如果我将指标缩减为:views、estimatedMinutesWatched,则查询工作正常。
这是我在 YouTube API 出现错误时得到的响应:
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: X-Origin
Content-Type: application/json; charset=UTF-8
Date: Wed, 06 Jan 2016 09:01:17 GMT
Expires: Wed, 06 Jan 2016 09:01:17 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
Content-Length: 461
{
"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."
}
}