|
 |
|
ปรึกษาเรื่อง google analytic ครับ จะเอาสถิติ มา ติดหน้าเว็บ |
|
 |
|
|
 |
 |
|
มันก็น่าจะทำได้แค่รูปภาพครับ 
|
 |
 |
 |
 |
Date :
2012-07-08 06:47:11 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หุหุ มีด้วยครับ ลองดู
Code (PHP)
<?php
define('ga_email','[email protected]');
define('ga_password','your_Google_Analytics_password');
define('ga_profile_id','YOUR GOOGLE ANALYTICS PROFILE ID');
require 'gapi.class.php';
$ga = new gapi(ga_email,ga_password);
$today = date('Y-m-d');
$search = array("2009","2010","01","02","03","04","05","06","07","08","09","10","11","12");
$replace = array("","","January","February","March","April","May","June","July","August","September","October","November","December");
$search2 = array ("<");
$replace2 = array ("");
$ga->requestReportData(ga_profile_id,array('month','year'),array('pageviews','visits','bounces','entrances'),array('-year','-month') ,$filter=null,$start_date='2009-03-01',$end_date=$today,$start_index=1,$max_results=1000);
?>
<table width="99%" align="center">
<tr>
<th>Month</th>
<th>Year</th>
<th>Pageviews</th>
<th>Visits</th>
</tr>
<?php
foreach($ga->getResults() as $result):
?>
<tr valign="center" align="center">
<td width="25%"><?php echo str_replace($search,$replace,$result) ?></td>
<td width="20%"><?php echo $result->getYear(str_replace($search2,$replace2,$result)) ?>
<td width="30%"><?php echo $result->getPageviews() ?></td>
<td width="25%"><?php echo $result->getVisits() ?></td>
</tr>
<?php
endforeach
?>
</table>
<br/><br/>
<table>
<tr>
<th>Total Months:</th>
<td><?php echo $ga->getTotalResults() ?></td>
</tr>
<tr>
<th>Total Pageviews</th>
<td><?php echo $ga->getPageviews() ?>
</tr>
<tr>
<th>Total Visits</th>
<td><?php echo $ga->getVisits() ?></td>
</tr>
<tr>
<th>Results Updated</th>
<td><?php echo $ga->getUpdated() ?></td>
</tr>
</table>
http://www.webupd8.org/2010/01/display-google-analytics-stats-on-your.html
|
 |
 |
 |
 |
Date :
2012-07-08 06:49:21 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ ขอไปลองดูก่อน ^^
|
 |
 |
 |
 |
Date :
2012-07-08 07:06:35 |
By :
armtp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|