tetsuo13 / matomo_tracking_api
将 Matomo 追踪服务器端代码添加到 Roundcube 的所有请求中
Requires
- roundcube/plugin-installer: >=0.1.3
This package is not auto-updated.
Last update: 2024-09-14 15:02:00 UTC
README
此插件使用 Matomo 追踪 API 将 Matomo 分析集成到 Roundcube 中。此插件与 Roundcube Webmail piwik 分析插件 非常不同,后者添加了客户端的 JavaScript 追踪标签。本插件的目标是在服务器端添加 Matomo 集成,以绕过同源策略。
如果你的 Matomo 安装与你的 Roundcube 安装在同一域名下,并且两者使用相同的协议,那么这个插件可能不是你需要的,因为它不会比 JavaScript 追踪标签带来任何显著的价值。以下是一些此插件表现良好的示例情况
- Matomo 在
http://analytics.company.com
,Roundcube 在https://webmail.company.com
- Matomo 在
http://analytics.company.com
,Roundcube 在http://webmail.othercompany.com
安装
使用 Composer 安装或手动下载并安装到 plugins/matomo_tracking_api
。将 config.inc.php.dist
复制到同一目录下的 config.inc.php
并使用以下选项编辑文件。
将 matomo_tracking_api 添加到你的 Roundcube 配置中的 $config['plugins']
以启用插件。
配置
将 config.inc.php.dist
复制到 config.inc.php
并编辑配置变量。未使用的可选变量设置为 null
。
matomo_tracking_api_url [字符串]
设置为 Matomo 安装的 URL。此 URL 必须可以从 Roundcube 安装中访问。
matomo_tracking_api_site_id [整数|数组(string => int)]
配置 Matomo 站点 ID。此变量的值可以是单个整数或包含多个服务器名称和 ID 的数组,在单个 Roundcube 安装服务于多个主机的情况下。
要设置多个主机,请使用服务器名称和 Matomo 网站 ID 的键/值对。例如
$rcmail_config['matomo_tracking_api_site_id'] = array( 'webmail.foo.com' => 42, 'webmail.bar.com' => 13 );
matomo_tracking_api_track_user_id [布尔值]
启用时,将使用用户的电子邮件地址连接多个设备和浏览器。有关更多信息,请参阅 Matomo 用户指南中的 用户 ID 的好处。
matomo_tracking_api_token_auth [字符串] (可选)
设置为 Matomo 用户的 token auth key 以利用高级追踪。如果提供,目前将使用以下内容
- 将远程 IP 设置为用户的 IP 而不是默认为 Roundcube 安装的 IP。