这几天网站后台的Google Analytics数据没有,不知道什么原因,请教大家一下。
我用的是脚本更新数据,每天2:30请求谷歌的接口,这几天每天都是失败,自己重新更新一次可以成功。不知道是不是被墙了,但是网上查的Google Analytics没有被墙。失败的方法是public function requestReportData(),此方法中最后有一段代码是:$response = $this->httpRequest(gapi::report_data_url, $parameters, null, $this->generateAuthHeader());
//HTTP 2xx
if(substr($response['code'],0,1) == '2')
{
return $this->reportObjectMapper($response['body']);
}
else
{
throw new Exception('GAPI: Failed to request report data. Error: "' . strip_tags($response['body']) . '"');
}
出错的原因就是请求Google Analytics地址时:$response['code'] != 200脚本执行也就提示GAPI: Failed to request report data. Error: "' . strip_tags($response['body']) . '"';不知道大家遇到过这个问题没有,怎么解决,求助
我用的是脚本更新数据,每天2:30请求谷歌的接口,这几天每天都是失败,自己重新更新一次可以成功。不知道是不是被墙了,但是网上查的Google Analytics没有被墙。失败的方法是public function requestReportData(),此方法中最后有一段代码是:$response = $this->httpRequest(gapi::report_data_url, $parameters, null, $this->generateAuthHeader());
//HTTP 2xx
if(substr($response['code'],0,1) == '2')
{
return $this->reportObjectMapper($response['body']);
}
else
{
throw new Exception('GAPI: Failed to request report data. Error: "' . strip_tags($response['body']) . '"');
}
出错的原因就是请求Google Analytics地址时:$response['code'] != 200脚本执行也就提示GAPI: Failed to request report data. Error: "' . strip_tags($response['body']) . '"';不知道大家遇到过这个问题没有,怎么解决,求助
但$response['code'] 是多少?
502/503被墙的可能性大,404可能是dns问题