Advertisement
Guest User

Errore_Gapi

a guest
Dec 23rd, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Statistiche Sito</title>
  6. </head>
  7.  
  8. <body>
  9. <?php
  10. define('ga_email','email');
  11. define('ga_password','password');
  12. define('ga_profile_id','20809415');
  13.  
  14. require 'gapi.class.php';
  15.  
  16. $ga = new gapi(ga_email,ga_password);
  17.  
  18. $filter = 'country' == 'Italy' && ( browser == Firefox || browser == 'Chrome');
  19.  
  20. $ga->requestReportData(ga_profile_id,array('browser','browserVersion'),array('pageviews','visits'),'-visits',$filter);
  21. ?>
  22. <table>
  23. <tr>
  24. <th>Browser &amp; Versione</th>
  25. <th>Pagine Visitate</th>
  26. <th>Visite</th>
  27. </tr>
  28. <?php
  29. foreach($ga->getResults() as $result):
  30. ?>
  31. <tr>
  32. <td><?php echo $result ?></td>
  33. <td><?php echo $result->getPageviews() ?></td>
  34. <td><?php echo $result->getVisits() ?></td>
  35. </tr>
  36. <?php
  37. endforeach
  38. ?>
  39. </table>
  40.  
  41. <table>
  42. <tr>
  43. <th>Risultati</th>
  44. <td><?php echo $ga->getTotalResults() ?></td>
  45. </tr>
  46. <tr>
  47. <th>Totale Pagine Visitate</th>
  48. <td><?php echo $ga->getPageviews() ?>
  49. </tr>
  50. <tr>
  51. <th>Totale Visite</th>
  52. <td><?php echo $ga->getVisits() ?></td>
  53. </tr>
  54. <tr>
  55. <th>Results Updated</th>
  56. <td><?php echo $ga->getUpdated() ?></td>
  57. </tr>
  58. </table>
  59. </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement