PHPのGoogleアナリティクスで検索概要を表示する方法??
Google アナリティクスのページが表示されました
訪問数 76
この機能を使用していますga:organicSearchesリンクはここdevelopers.google.com/analytics/devguides/reporting/core です
このデータを新しい分析 Web サイト内に表示したいのですが、この関数では74 回の訪問が表示されます
どこが間違っているかわかるかもしれません。
これまでの私のコードは次のとおりです:-
$ga1 = new gapi($ga_email,$ga_password);
/* We are using the 'source' dimension and the 'visits' metrics */
$dimensions = array('source');
$metrics = array('visits','organicSearches');
/* We will sort the result be desending order of visits,
and hence the '-' sign before the 'visits' string */
$ga1->requestReportData($ga_profile_id,
$dimensions,
$metrics,
'-visits', // Sort by 'visits' in descending order
$filter, // Filter the data
'2012-10-05', // Start Date
'2012-11-04', // End Date
1, // Start Index
500 // Max results
);
$gaResults = $ga1->getResults();
$i=1;
foreach($gaResults as $result)
{
printf("%-4d %-40s %5d\n",
$i++,
$result->getSource(),
$result->getVisits());
}
echo "\n-----------------------------------------\n";
echo "Total Results : {$ga1->getTotalResults()}";
echo "getOrganicSearches:".$ga1->getOrganicSearches().'<br />';
このデータを表示する他の機能はありますか???
ありがとう