YouTube Analytics API不会返回ROWS以查询特定视频 [英] YouTube Analytics API doesn't return ROWS for query for a specific video

查看:100
本文介绍了YouTube Analytics API不会返回ROWS以查询特定视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用YouTube Analytics API来获取针对特定查询的分析。

对于频道查询,它的效果非常好。问题发生了,当我执行一个特定的视频查询..就像这样(开始定义):

  / *** ************************** 
* deviceType-stats
************ ***************** /
$ optparams = array('dimensions'=>'deviceType',
filters=>video = =。$ videoId,
);
$ currentDate = date(Y-m-d,time());
$ resDeviceTypes = $ youtubeService-> analytics-> reports-> query(
channel ==。$ videoendorsement-> ytchannelid
,$ startDate
, $ currentDate
,views,estimatedMinutesWatched
,$ optparams);

对于此查询,我没有得到任何结果ROWS,但仅对某些视频ID。对于其他视频ID,它可以工作。顺便说一句:我没有得到任何结果的视频ROWS在YouTube上2天后在线。我从API获得结果后需要等一会儿吗?!



总体而言,还有一个问题需要获得任何视频的人口统计学和地理位置。无论我使用哪个视频ID,我都没有得到任何结果ROWS用于人口统计和地理统计。



有人知道问题出在哪里吗?

解决方案

当没有结果符合指定的条件时,不会返回任何行。例如,如果您在发布视频之前查询某个日期范围。


I am using the YouTube Analytics API to get analytics for specific queries.

For channel queries it works great. Problems occurred, when I execute a query for a specific video..like this (start is defined):

/*****************************
 * deviceType-stats
 *****************************/
$optparams = array('dimensions' => 'deviceType',
                    "filters" => "video==" . $videoId,
                );    
$currentDate = date("Y-m-d", time());
$resDeviceTypes = $youtubeService->analytics->reports->query(
            "channel==" . $videoendorsement->ytchannelid
            ,$startDate
            ,$currentDate
            ,"views,estimatedMinutesWatched"
            ,$optparams);

I don't get any result ROWS for this query, but only for some video Ids. For other video Ids it works. Btw: The videos where I don't get any result ROWS are online since 2 days on YouTube. Do I have to wait a little bit longer since I get a result from API?!

Overall there is additionally a problem to get demography and geography for any video. Doesn't matter which video Id I use, I don't get any result ROWS for demography and geography stats.

Does anybody know where the problem is?

解决方案

When no results match the criteria specified, no rows are returned. For example, if you query for a range of dates prior to a video being published.

这篇关于YouTube Analytics API不会返回ROWS以查询特定视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆