waldhacker/typo3-plausibleio

该软件包已被废弃,不再维护。作者建议使用 dreistromland/typo3-plausibleio 软件包。

适用于TYPO3 CMS的隐私友好型分析集成。使用Plausible Analytics分析您的受众,并在TYPO3后端直接查看分析数据的仪表板。

安装次数 1,742

依赖项: 0

建议者: 0

安全性: 0

星标: 2

关注者: 2

分叉: 1

公开问题: 4

类型:typo3-cms-extension

3.0.0 2024-02-23 00:02 UTC

This package is auto-updated.

Last update: 2024-05-28 10:42:10 UTC


README

CI

⚠️

此仓库不再维护。
将不会考虑或批准任何问题或拉取请求。
维护和进一步开发感谢由 @dreistromland 负责。
新的代码库可以在 此仓库 中找到。有关迁移的详细信息,请参阅那里。感谢 @dreistromland 接管进一步开发,并感谢所有用户对他们的信任。

⚠️

适用于TYPO3 CMS的Plausible Analytics隐私友好型分析集成。

使用Plausible Analytics分析您的受众,并在TYPO3后端直接查看分析数据的仪表板。

Plausible Analytics是一个隐私友好、无cookies、轻量级且开源的分析替代方案 - 您可以在 https://# 使用他们的服务,或者在您自己的平台上 自行托管服务

Image of Dashboards

安装

使用Composer

composer require waldhacker/typo3-plausibleio

不使用Composer

配置

站点语言

扩展主要在站点语言中进行配置:站点管理 / 站点 / <站点配置> / 语言 / <站点语言> / Plausible Analytics

Image of plausible configuration within site language settings

以下设置可用

Plausible API基础URL

Plausible API端点可访问的基础URL。
如果您使用plausible.io服务,则为 https://#/
如果您使用的是自托管的Plausible实例,请在此处添加您的Plausible域名(例如 https://analytics.example.com/)。

Plausible API密钥

一个Plausible API令牌。如果您还没有,您可以在您的Plausible实例中创建一个,在 设置 / API密钥 中。

Image of Plausible settings

站点

一个Plausible站点ID。
通常是您的域名或子域名,不带 www(例如 waldhacker.devblog.waldhacker.dev)。
站点ID也是您在创建新站点时在Plausible实例中输入的内容。

Image of Plausible settings

自动包含Plausible跟踪代码片段

如果开启,则 Plausible跟踪脚本 将自动包含在前端。

如果您不想自动集成,您也可以通过在模板中使用资产收集器手动插入脚本,如下所示

<f:asset.script identifier="analytics" src="https://#/js/plausible.js" data="{'domain':'waldhacker.dev'}" priority="1" async="async" defer="defer" />

Plausible跟踪代码片段基础URL

Plausible 跟踪脚本可访问的基础 URL。
它必须是 js/plausible.js 前的部分。所以如果你的 Plausible 跟踪脚本位于 https://analytics.example.com/js/plausible.js,那么在这里放置 https://analytics.example.com/
如果您使用plausible.io服务,则为 https://#/

URL 很可能是 "Plausible API 基础 URL" 相同。然而,由于广告拦截器,跟踪脚本可能需要从另一个域名加载。因此,Plausible 跟踪脚本的基础 URL 必须在此处单独配置。

Plausible 跟踪代码类型

Plausible 为各种用例提供不同的跟踪脚本
可以在此选择其中一种脚本(默认为 plausible.js)。

扩展配置

一些选项在 Admin Tools / Extension Configuration / plausibleio 中的扩展配置中设置。

Image of plausible configuration within the extension settings

时间框架

在仪表板小部件中可选的时间框架的逗号分隔列表 - 在 https://#/docs/stats-api#time-periods 查看可能的选项(目前 custom 不可用)。

默认时间框架

在渲染小部件时最初使用的时间框架。

高级配置

Service.yaml

如果您希望在单个仪表板上看到具有预配置值的多个小部件,可以通过在文件 Configuration/Services.yaml 中的小部件配置来实现。
因此,可以在仪表板上创建例如 Countries 小部件两次。一个显示 site1.example.com 的国家地图,另一个显示 site2.example.com 的国家地图。

从文件 EXT:plausibleio/Configuration/Services.yaml 中复制 waldhacker.plausibleio.widget.country 小部件

  waldhacker.plausibleio.widget.country:
    class: 'Waldhacker\Plausibleio\Dashboard\Widget\CountryMapDataWidget'
    arguments:
      $configurationService: '@Waldhacker\Plausibleio\Services\ConfigurationService'
      $options:
        siteId: null
        timeFrame: null
    tags:
      - name: dashboard.widget
        identifier: 'plausible.countrymapdata'
        groupNames: 'plausibleio'
        title: 'LLL:EXT:plausibleio/Resources/Private/Language/locallang.xlf:widget.countryMapData.label'
        description: 'LLL:EXT:plausibleio/Resources/Private/Language/locallang.xlf:widget.countryMapData.description'
        iconIdentifier: 'content-widget-chart-bar'
        height: 'medium'
        width: 'medium'

到您的站点包 Configuration/Services.yaml 文件中,并按如下方式调整配置

  # Countries widget fixed to site1.example.com
  yourname.plausibleio.widget.country.site1:
    class: 'Waldhacker\Plausibleio\Dashboard\Widget\CountryMapDataWidget'
    arguments:
      $configurationService: '@Waldhacker\Plausibleio\Services\ConfigurationService'
    $options:
      siteId: site1.example.com
      timeFrame: 30d
  tags:
    - name: dashboard.widget
      identifier: 'yourname.countrymapdata.site1'
      groupNames: 'plausibleio'
      title: 'LLL:EXT:yourpackage/Resources/Private/Language/locallang.xlf:widgets.countryMapData.label'
      description: 'LLL:EXT:yourpackage/Resources/Private/Language/locallang.xlf:widgets.countryMapData.description'
      iconIdentifier: 'content-widget-chart-bar'
      height: 'medium'
      width: 'medium'

  # Countries widget fixed to site2.example.com
  yourname.plausibleio.widget.country.site2:
    class: 'Waldhacker\Plausibleio\Dashboard\Widget\CountryMapDataWidget'
    arguments:
      $configurationService: '@Waldhacker\Plausibleio\Services\ConfigurationService'
    $options:
      siteId: site2.example.com
      timeFrame: 30d
  tags:
    - name: dashboard.widget
      identifier: 'yourname.countrymapdata.site2'
      groupNames: 'plausibleio'
      title: 'LLL:EXT:yourpackage/Resources/Private/Language/locallang.xlf:widgets.countryMapData.label'
      description: 'LLL:EXT:yourpackage/Resources/Private/Language/locallang.xlf:widgets.countryMapData.description'
      iconIdentifier: 'content-widget-chart-bar'
      height: 'medium'
      width: 'medium'

$options 中,您可以将小部件固定到 Plausible 网站 ID 和/或时间框架。

从版本 1.x 迁移到 2.x

在版本 1.x 中,“Plausible API 基础 URL”(baseUrl),“Plausible API 密钥”(apiKey)和“站点”(siteId)在扩展配置($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['plausibleio'])中设置。然而,这仅允许在 TYPO3 安装中配置一个 Plausible 网站ID。

这三个配置选项已从版本 2.x 移动到站点语言配置。您必须手动将您在扩展配置(版本 1.x)中输入的值转移到站点语言配置中,没有自动迁移脚本。

从版本 2.x 迁移到 3.x

由于 Breaking-96812-NoFrontendTypoScriptBasedTemplateOverridesInTheBackend,您需要从文件 Configuration/Services.yaml 中的小部件配置中删除行 $view: '@dashboard.views.widget'