revstrat/bloganalytics
Composer 安装命令:
composer require revstrat/bloganalytics
包简介
Pulls Google Analytics data and provides queued jobs for updating data
关键字:
README 文档
README
Pull data out of Google Analytics for pages and blog tags
Requirements
- SilverStripe ^4
- [SilverStripe Blog ^3.2 (for tag traffic)] (https://github.com/silverstripe/silverstripe-blog)
- SilverStripe Queued Jobs ^4.2
Documentation
The SilverStripe BlogAnalytics module uses a Google Service Account to interact with Google Analytics.
- Set up a service account here. You will receive a configuration such as this:
{
"type": "service_account",
"project_id": "YOUR GOOGLE API PROJET ID",
"private_key_id": "YOUR PRIVATE KEY ID",
"private_key": "YOUR PRIVATE KEY",
"client_email": "EMAIL ADDRESS FOR THE SERVICE ACCOUNT",
"client_id": "CLIENT ID",
"auth_uri": "AUTH URI",
"token_uri": "TOKEN URI",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "CERT URL"
}
- Add the email address for the account to Google Analytics
- Get a View ID for the Analytics view you wish to pull from
- base64 encode the configuration
- Add configuration to your environment:
GASERVICE="BASE64 ENCODED JSON CONFIGURATION FILE CONTENTS (to avoid escaping values in the private key)" GAVIEW="VIEW ID" GASTART="7daysago" GAEND="today" GAMINCUTOFF="100" # Don't track pages with fewer views than this
- Install with
composer require revstrat\bloganalytics - Run
/dev/build?flush=all. - Create a queued job of type RevStrat\BlogAnalytics\UpdateTrafficData and run it. The task will schedule itself on completion for 3 hours in the future
Template Usage
Examples:
TopTags, TopSiteTree, TopBlogPosts each return a list, with the target object itself under "Item", and the traffic count under "Traffic".
Each can take an argument to override the default result count limit.
<h3>Top Tags</h3>
<% loop TopTags(6) %>
$Item.Title, $Traffic<br />
<% end_loop %>
<% loop TopSiteTree %>
$Item.Title, $Traffic<br />
<% end_loop %>
<% loop TopBlogPosts %>
$Item.Title, $Traffic<br />
<% end_loop %>
revstrat/bloganalytics 适用场景与选型建议
revstrat/bloganalytics 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 206 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 09 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「blog」 「analytics」 「silverstripe」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 revstrat/bloganalytics 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 revstrat/bloganalytics 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 revstrat/bloganalytics 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel package for opinionated blog implementation
Analytics chooser extensions for site settings.
A Laravel Nova Card to show Fathom Analytics stats.
Import an RSS-feed into blog
CitaNZ's SilverStripe picture object and field for SilverStripe 4
统计信息
- 总下载量: 206
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-09-13