getResults
のパラメータの使い方は?私は、私のウェブサイトのユーザーのURLが何を見ているかについての情報を得る必要があります。私がga:sessions
を使用している場合、私はそこに何人のユーザーがいるかを見ます。 ga:pageviews
に変更すると、結果の配列の数値が変更されます。つまり、APIは「生きている」という意味です。Google Analytics APIのパラメータの使い方
私のウェブサイトを見ている人々のどこにURL「入力ポイント」を得るにはどうすればいいですか?そして、この場所でパラメータを送信する方法'ga:sessions');
? 私が読んでいたAPI命令はhereです。今結果を
function getResults(&$analytics, $profileId) {
// Calls the Core Reporting API and queries for the number of sessions
// for the last seven days.
return $analytics->data_ga->get(
'ga:' . $profileId,
'7daysAgo',
'today',
'ga:sessions');
}
function printResults(&$results) {
// Parses the response from the Core Reporting API and prints
// the profile name and total sessions.
if (count($results->getRows()) > 0) {
// Get the profile name.
$profileName = $results->getProfileInfo()->getProfileName();
// Get the entry for the first entry in the first row.
$rows = $results->getRows();
// $sessions = $rows[0][0];
// Print the results.
echo '<pre>';
print_r($rows);
} else {
print "No results found.\n";
}
}
は次のとおりです。
Array
(
[0] => Array
(
[0] => 3585
)
)
ありがとう!結果ページをページの後に表示する方法は? Cuzのデフォルトの最大結果は1kです – fonjeekay
私はその申し訳ありませんのためのコードを持っていません。しかし、私はあなたのリクエストの結果のnextpageトークンを読んだ後、新しいリクエストをパラメータとして新しいリクエストに渡すのは、次元を追加したように、新しいリクエストをhttps://developers.google.com/api-client-ライブラリ/ php/guide/pagination申し訳ありません私はそれをしてからしばらくしています。 – DaImTo