我是GAPI的新手。我想在移动设备和桌面上使用GAPI找到前10页的网站..我编写了这个..
<?php
define('ga_email','xxxxxxxxxxxxxx@gmail.com');
define('ga_password','xxxxxxxxxxxxxxx');
define('ga_profile_id','xxxxxxxxxxx');
require 'gapi.class.php';
$ga = new gapi(ga_email,ga_password);
$ga->requestReportData(ga_profile_id,array('browser','browserVersion'),array('pageviews','visits'));
//echo '<pre>';print_r($ga->getResults());exit;
?>
<table>
<tr>
<th>Browser & Browser Version</th>
<th>Pageviews</th>
<th>Visits</th>
</tr>
<?php
foreach($ga->getResults() as $result):
?>
<tr>
<td><?php echo $result ?></td>
<td><?php echo $result->getPageviews() ?></td>
<td><?php echo $result->getVisits() ?></td>
</tr>
<?php
endforeach
?>