Download the PHP package t3g/analytics without Composer

On this page you can find all versions of the php package t3g/analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package analytics

TYPO3 Analytics Extension

A TYPO3 backend extension that integrates TYPO3 Analytics into the TYPO3 site management panel. It lets editors register TYPO3 sites with the TYPO3 Analytics API, monitor registration status, and open the analytics dashboard — all without leaving the TYPO3 backend.

Contents

Requirements

Component Version
PHP ^8.2
TYPO3 ^13.4 or ^14.0
libsodium PHP extension (bundled since PHP 7.2)

What the extension does

The extension adds a Sites → Analytics module to the TYPO3 backend. For each configured TYPO3 site it provides:

Encryption

Credentials are encrypted using XChaCha20-Poly1305 via libsodium. On TYPO3 v14+ the built-in TYPO3\CMS\Core\Crypto\Cipher\CipherService is used automatically; on v13 an equivalent custom implementation is used, ensuring values remain decryptable after an upgrade.

Module icon

Two icon variants are shipped and selected automatically at runtime based on the installed TYPO3 version:

File Used on Design
Resources/Public/Icons/Extension.svg TYPO3 v14+ Adaptive — uses var(--icon-color-accent) and currentColor to follow the backend theme
Resources/Public/Icons/Extension-v13.svg TYPO3 v13 Material Design — solid orange background with white bar-chart bars

Installation

Composer (recommended)

Activate the extension in the TYPO3 Extension Manager or via:

TER / Classic mode

In a non-Composer TYPO3 installation, search for analytics in Admin Tools → Extensions and install it from there. Make sure the Dashboard system extension is active before installing.

Deployment note

Site-specific data written by the extension (credentials, tracking code, API keys) is stored in each site's config/sites/<identifier>/settings.yaml. This file contains sensitive values and must not be committed to the repository. In a deployment setup, keep settings.yaml in a shared folder outside the release directory and symlink or copy it on each deploy.

Configuration reference

Development settings

Key Type Default Description
demoData bool 0 When enabled, replaces all analytics API calls with static demo data. Only takes effect in the TYPO3 Development application context.

Dashboard settings

Key Type Default Description
dashboardPeriods string 7,14,30 Comma-separated list of period options (in days) shown in all dashboard widget dropdowns and the page performance bar. Must be positive integers.
dashboardDefaultPeriod int 7 Pre-selected period (in days) for all dashboard widgets. Must be one of the values in dashboardPeriods.

Example — custom period options:

Cache settings

Key Type Default Description
pageAnalyticsCacheTtl int 3600 Lifetime in seconds for all analytics data caches. Increase this value to reduce API calls on high-traffic backend installations.

Example — longer cache lifetime:

Modules and widgets

Backend module — Sites → Analytics

Registered as site_analytics (route prefix site_analytics.*). Visible in the Sites section of the backend module menu.

The module overview page shows:

Per-site views offer:

The registration form, plan management button, and status refresh button are only visible to backend administrators and users who hold the Analytics Manager custom option (see Access control below).

Dashboard widgets

The extension registers four dashboard widget types, each available in a TYPO3 v13 variant (inline dropdowns, AJAX-driven) and a TYPO3 v14+ variant (native widget settings panel).

All v14+ widgets share two common settings in addition to their widget-specific ones:

Setting Type Default Description
Title string (widget default) Overrides the widget title shown in the dashboard header. Leave empty to use the default.
Show site & period in title bool true Appends the selected site name and period in parentheses to the widget title, e.g. Traffic Sources (My Site · 7 days).

Top Pages widget

Displays a ranked list of the most-visited pages for a configured site. Each row shows the page title, URL, and view count. Results are sorted by page views descending; a configurable limit controls how many rows are shown. A "Show all" link leads to the pages view of the analytics dashboard.

Variant Class Widget ID TYPO3 version
v13 TopPagesWidget dashboard.widget.analyticsTopPages ^13.4
v14+ TopPagesWidgetV14 dashboard.widget.analyticsTopPagesV14 ^14.0

Widget settings (v14+): Site, Period (days), Limit (number of pages shown), plus the common settings above.

AJAX endpoint (v13): TopPagesAjaxController — registered as backend route analytics_top_pages_content.

Site Performance widget

Displays four colored metric tiles for a configured site — Visits, Visitors, Bounce rate, and Avg. visit duration — each showing the current value and a trend arrow compared to the previous period of equal length.

Variant Class Widget ID TYPO3 version
v13 SitePerformanceWidget dashboard.widget.analyticsSitePerformance ^13.4
v14+ SitePerformanceWidgetV14 dashboard.widget.analyticsSitePerformanceV14 ^14.0

Widget settings (v14+): Site, Period (days), plus the common settings above.

AJAX endpoint (v13): SitePerformanceAjaxController — registered as backend route analytics_site_performance_content.

Traffic Graph widget

Displays a full-width line chart of daily visit counts for a configured site over the selected period. The chart makes traffic trends immediately visible — spikes, dips, and patterns across the chosen date range. A "Show all" link opens the main analytics dashboard.

Variant Class Widget ID TYPO3 version
v13 TrafficGraphWidget dashboard.widget.analyticsTrafficGraph ^13.4
v14+ TrafficGraphWidgetV14 dashboard.widget.analyticsTrafficGraphV14 ^14.0

Widget settings (v14+): Site, Period (days), plus the common settings above.

AJAX endpoint (v13): TrafficGraphAjaxController — registered as backend route analytics_traffic_graph_content.

Traffic Sources widget

Displays a breakdown of incoming traffic by channel, browser, device type, or country. Each entry shows a label, share as a percentage, and a horizontal progress bar. Channel and channel entries also display a trend indicator compared to the previous period. Entries outside the top results are aggregated into an "Others" row.

The two TYPO3 version variants differ significantly in how sections are displayed:

v13 — TrafficSourcesWidget / dashboard.widget.analyticsTrafficSources / ^13.4

All four sections (Channel, Devices, Browser, Countries) are rendered inside a single widget, stacked vertically. Site and period are selected via inline dropdowns; the chart is always a progress-bar list. No chart-type configuration is available.

AJAX endpoint: TrafficSourcesAjaxController — registered as backend route analytics_traffic_sources_content.

v14+ — TrafficSourcesWidgetV14 / ^14.0

A DI compiler pass registers four separate widget types, one per section, each with a fixed section and a pre-configured default chart type. The section cannot be changed by the user at runtime.

Widget ID Section Default chart type
dashboard.widget.analyticsTrafficSourcesChannel Channel list
dashboard.widget.analyticsTrafficSourcesDevices Devices donut
dashboard.widget.analyticsTrafficSourcesBrowser Browser donut
dashboard.widget.analyticsTrafficSourcesCountries Countries list

Channel

Browser

Devices

Countries

Widget settings (v14+):

Setting Type Default Description
Site string first registered site Site to display data for.
Period int dashboardDefaultPeriod Time window in days.
Chart type enum (per widget) Display as list (progress bars) or donut (SVG donut chart, top 5 + aggregated "Other").

Plus the common settings above.

Page Performance Bar

An event listener (PagePerformanceBarListener) on ModifyPageLayoutContentEvent that injects an analytics bar above the page content in the Page module.

The bar loads asynchronously: on page render, only a lightweight skeleton with a loading spinner is injected into the page header. The JavaScript in page-performance.js then fetches the actual analytics data via AJAX (PagePerformanceAjaxController, route analytics_page_performance_content) and replaces the skeleton with the fully rendered bar.

The bar shows per-page metrics for the currently viewed page:

A period selector (values from dashboardPeriods) and a link to the full site analytics dashboard are included. The bar is hidden in language-comparison mode (viewMode = 2).

Dashboard preset

The extension ships a ready-made Analytics Overview dashboard preset (analyticsOverview) that can be selected when creating a new TYPO3 dashboard. It pre-populates the dashboard with all four widget types:

The preset is registered in Configuration/Backend/DashboardPresets.php and shown in the dashboard creation wizard (showInWizard: true).

Access control

The Sites → Analytics module is accessible to all backend users. However, the following actions are restricted to administrators and users who hold the tx_analytics:manager custom option:

The custom option is configured via Backend Groups → Custom Options → Analytics → Analytics Manager (TCA value: tx_analytics:manager).

Local development with DDEV

The repository ships a fully automated DDEV environment that spins up a dummy TYPO3 installation with five sub-domain sites.

Prerequisites

Start the environment

On first start DDEV automatically runs the setup script. You will be prompted to choose the TYPO3 major version:

The script will:

  1. Create a fresh TYPO3 project in .Build/dummy-typo3/ using typo3/cms-base-distribution
  2. Drop and recreate the database for a clean slate
  3. Require and symlink this extension from the repository root
  4. Run vendor/bin/typo3 setup non-interactively
  5. Create five root pages (Site 1–5)
  6. Write site configurations for five subdomains
  7. Remove the FIRST_INSTALL flag so the backend is immediately accessible

Available URLs after setup

URL Description
https://analytics.ddev.site/typo3 TYPO3 backend
https://site1.analytics.ddev.site/ Frontend site 1
https://site2.analytics.ddev.site/ Frontend site 2
https://site3.analytics.ddev.site/ Frontend site 3
https://site4.analytics.ddev.site/ Frontend site 4
https://site5.analytics.ddev.site/ Frontend site 5
https://analytics.ddev.site:1337 Documentation preview

Backend credentials: admin / Admin1234!

Re-run setup manually

Reset everything

Documentation preview

The ddev-typo3-docs add-on renders the .rst files in Documentation/ with the same renderer used by docs.typo3.org. It starts automatically with ddev start/ddev restart and watches for changes.

Open https://analytics.ddev.site:1337 and edit files under Documentation/ — the preview re-renders automatically on save.

Code quality

Tests

Unit tests use the TYPO3 testing framework with an in-process bootstrap. Functional tests use SQLite via pdo_sqlite — no external database server is required.

Compatibility notes

TYPO3 v13

TYPO3 v14


All versions of analytics with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-sodium Version *
typo3/cms-core Version ^13.4 || ^14.0
typo3/cms-backend Version ^13.4 || ^14.0
typo3/cms-dashboard Version ^13.4 || ^14.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package t3g/analytics contains the following files

Loading the files please wait ...