famouswolf/matomoapi
Composer 安装命令:
composer require famouswolf/matomoapi
包简介
TYPO3 extension to talk to Matomo API and display it with a template
README 文档
README
TYPO3 extension to connect to the Matomo API and show the result using a Fluid template.
Requirements
- TYPO3 CMS 10.4
- PHP 7.2+
- Licence: GPL 3.0
Manual
After installing the extension you need to configure the Matomo API call through TypoScript. You can then add the plugin, either through TypoScript or as a content element. The default template will show the returned data using f:debug, so most likely you'll want to create a custom template.
More about the Matomo API can be found here: https://developer.matomo.org/api-reference/reporting-api
TypoScript
| Key | Description | Type |
|---|---|---|
| view.templateRootPaths | Template root paths | Array |
| view.partialRootPaths | Partial root paths | Array |
| view.layoutRootPaths | Layout root paths | Array |
| settings.apiUrl | URL for the Matomo API | String |
| settings.tokenAuth | The Matomo API authentication token | String |
| settings.method | The method to call in the Matomo API | String |
| settings.parameters | The parameters to send to the Matomo API | Array |
Examples
Get the number of visits in the last 30 days
TypoScript
plugin.tx_matomoapi {
settings {
apiUrl = https://example.org/matomo/index.php?
tokenAuth = 1234567890abcdef1234567890abcdef
method = VisitsSummary.get
parameters {
idSite = 1
period = range
date = last30
}
}
}
Fluid template
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"> <f:layout name="Default" /> <f:section name="Content"> Visits in the last 30 days: {data.nb_visits} </f:section> </html>
Get the most visited page URL for yesterday
TypoScript
plugin.tx_matomoapi {
settings {
apiUrl = https://example.org/matomo/index.php?
tokenAuth = 1234567890abcdef1234567890abcdef
method = Actions.getPageUrls
parameters {
idSite = 1
period = day
date = yesterday
flat = 1
filter_limit = 1
}
}
}
Fluid template
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"> <f:layout name="Default" /> <f:section name="Content"> <f:if condition="{data.0}"> <f:then> <a href="{data.0.url}">Most visited page yesterday</a> </f:then> <f:else> There were no visitors yesterday or something went wrong </f:else> </f:if> </f:section> </html>
famouswolf/matomoapi 适用场景与选型建议
famouswolf/matomoapi 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 06 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 famouswolf/matomoapi 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 famouswolf/matomoapi 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2020-06-06