Exception: GAPI: Failed to request account data. Error:
" Error 404 (Not Found)!!1 *
{
margin: 0;
padding: 0;
}
html,
code { font: 15px/22px arial,sans-serif }
html {
background: #fff;
color: #222;
padding: 15px;
}
body {
margin: 7% auto 0;
max-width: 390px;
min-height: 180px;
padding: 30px 0 15px;
}
* > body {
background: url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;
padding-right: 205px;
}
p {
margin: 11px 0 22px;
overflow: hidden;
}
ins {
color: #777;
text-decoration: none;
}
a img { border: 0 }
@media screen and (max-width:772px) {
body {
background: none;
margin-top: 0;
max-width: none;
padding-right: 0;
}
}
404. That's an error. The requested URL
/analytics/feeds/accounts/default?start-index=1&max-results=20
was not found on this server. That's all we know. "
2005 次
2 に答える
5
はい、GAPI は長い間更新されていません。また、Google はファースト パーティの PHP ライブラリとチュートリアルを提供しています。どちらも混乱しており、小規模なスクリプトでは誇張されています。
ただし、次のスレッドに従ってすぐに GAPI を修復できます: https://code.google.com/p/gapi-google-analytics-php-interface/issues/detail?id=84
特に、GAPI クラスの先頭にパッチを適用し、次のように置き換える必要があります。
const client_login_url = 'https://www.google.com/accounts/ClientLogin';
const account_data_url = 'https://www.googleapis.com/analytics/v2.4/management/accounts/~all/webproperties/~all/profiles'; //https://www.google.com/analytics/feeds/accounts/default
const report_data_url = 'https://www.googleapis.com/analytics/v2.4/data';
そこからは、期待どおりに動作します。
于 2013-06-19T12:15:54.033 に答える
1
これは、Palantirの答えに対するイデションです。
ヘッドにパッチを適用することに加えて、「未定義の変数」エラーを取り除くために次の行を変更する必要があります。
$account_root_parameters['startDate'] = strval($google_results->startDate);
$account_root_parameters['endDate'] = strval($google_results->endDate);
次のようにする必要があります。
$account_root_parameters['startDate'] = strval($xml->startDate);
$account_root_parameters['endDate'] = strval($xml->endDate);
于 2013-10-12T09:01:21.770 に答える