Embeddable Google Analytics quot;Flairquot;?(可嵌入的谷歌分析“天赋?)
问题描述
现在 Google Analytics 有了官方 API,是否有任何实现小而简约的天赋"之类的片段,显示可自定义的统计数据选择,例如今天和本周的访问者,可能还有一两个图表 - 嵌入到自己的管理中面板和后端应用程序?
Now that Google Analytics has an official API, are there any implementations of a small, minimalistic "Flair" like snippet showing a customizable selection of stats, say for example, today's and the week's visitors, and maybe a chart or two - to embed into one's own admin panels and back-end applications?
我正在理想地寻找基于 PHP 的实现;完美的解决方案将能够独立运行(没有大的依赖)并且只需要输入 API 密钥/登录数据即可开始.干净的代码和 PHP 5 OOP 将是一个加分项.
I am ideally looking for implementations based on PHP; the perfect solution would be able to run stand-alone (no big dependencies) and require just to put in the API key / login data to get started. Clean code and PHP 5 OOP would be a plus.
推荐答案
GAPI 听起来像您所需要的.
GAPI sound like what you need.
GAPI(表示g,a,p,i")是 Google Analytics PHP5 接口.
GAPI (said 'g,a,p,i') is the Google Analytics PHP5 Interface.
http://code.google.com/p/gapi-google-analytics-php-interface/
如下使用:
$ga = new gapi('email@yourdomain.com','password');
$ga->requestReportData(145141242,array('browser','browserVersion'),array('pageviews','visits'));
foreach($ga->getResults() as $result)
{
echo '<strong>'.$result.'</strong><br />';
echo 'Pageviews: ' . $result->getPageviews() . ' ';
echo 'Visits: ' . $result->getVisits() . '<br />';
}
echo '<p>Total pageviews: ' . $ga->getPageviews() . ' total visits: ' . $ga->getVisits() . '</p>';
这篇关于可嵌入的谷歌分析“天赋"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:可嵌入的谷歌分析“天赋"?


- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01