Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Statistiche Sito</title>
- </head>
- <body>
- <?php
- define('ga_email','email');
- define('ga_password','password');
- define('ga_profile_id','20809415');
- require 'gapi.class.php';
- $ga = new gapi(ga_email,ga_password);
- $filter = 'country' == 'Italy' && ( browser == Firefox || browser == 'Chrome');
- $ga->requestReportData(ga_profile_id,array('browser','browserVersion'),array('pageviews','visits'),'-visits',$filter);
- ?>
- <table>
- <tr>
- <th>Browser & Versione</th>
- <th>Pagine Visitate</th>
- <th>Visite</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
- ?>
- </table>
- <table>
- <tr>
- <th>Risultati</th>
- <td><?php echo $ga->getTotalResults() ?></td>
- </tr>
- <tr>
- <th>Totale Pagine Visitate</th>
- <td><?php echo $ga->getPageviews() ?>
- </tr>
- <tr>
- <th>Totale Visite</th>
- <td><?php echo $ga->getVisits() ?></td>
- </tr>
- <tr>
- <th>Results Updated</th>
- <td><?php echo $ga->getUpdated() ?></td>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement