---
title: "Pageview"
manual: "Tracking Extension"
version: "4.1"
permalink: "https://docs.typo3.org/permalink/danielsiepmann/tracking:pageview@4.1"
source: "Pageview.rst"
rendered: "2026-12-01T16:22:07+00:00"
---

# Pageview {#pageview}

Each view of a TYPO3 page is tracked by default.
Requests can be ignored by configuring a rule that has to match the current request.

All configuration happens via [Dependency injection](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/DependencyInjection/Index.html#dependencyinjection) inside of `Services.yaml` of your Sitepackage.

![](Images/ListViewPageviews.png)

![](Images/RecordPageview.png)

## Saved record {#saved-record}

Whenever a pageview is tracked, a new record is created.
The record can be viewed via TYPO3 list module. That way all collected information can be checked.

## Configure tracking {#configure-tracking}

Let us examine an concrete example:

```yaml
services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  DanielSiepmann\Tracking\Middleware\Pageview:
    public: true
    arguments:
      $rule: >
          not (context.getAspect("backend.user").isLoggedIn())
          and not (context.getAspect("frontend.preview").isPreview())
          and traverse(request.getHeader("User-Agent"), '0')
          and not (request.getHeader("User-Agent")[0] matches "/^TYPO3|TYPO3 linkvalidator/")
          and not (request.getHeader("User-Agent")[0] matches "/^Codeception Testing/")
          and not (request.getHeader("User-Agent")[0] matches "/Wget|curl|Go-http-client/")
          and not (request.getHeader("User-Agent")[0] matches "/bot|spider|Slurp|Sogou|NextCloud-News|Feedly|XING FeedReader|SEOkicks|Seekport Crawler|ia_archiver|TrendsmapResolver|Nuzzel/")
          and not (request.getHeader("User-Agent")[0] matches "/mattermost|Slackbot|WhatsApp/")

```

The first paragraph will not be explained, check out [Configuration](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/DependencyInjection/Index.html#configure-dependency-injection-in-extensions) instead.

The second paragraph is where the tracking is configured.
The PHP class `DanielSiepmann\Tracking\Middleware\Pageview` is registered as PHP middleware and will actually track the request.
Therefore this class is configured.
The only interesting argument to configure is `$rule`,
which is a [Symfony Expression](https://symfony.com/doc/current/components/expression_language/syntax.html).
The same is used by TYPO3 for TypoScript conditions and is not explained here.

This rule is evaluated to either `true` or `false`,
where `true` means that the current request should be tracked.

The current request is available as `Psr\Http\Message\ServerRequestInterface` via `request`,
while `TYPO3\CMS\Core\Context\Context` is available via `context`.
That way it is possible to check all kind of information like frontend user, backend user or cookies and parameters,
as well as request header.

Check [PSR-7: HTTP message interfaces](https://www.php-fig.org/psr/psr-7/#321-psrhttpmessageserverrequestinterface)
as well as
[Context API and aspects](https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Context/Index.html#context-api).

The above example blocks tracking for requests with logged in backend user,
as well as specific user agents like bots, TYPO3 itself and other systems.

## Widgets {#widgets}

The extension does not provide any widgets, but providers for widgets of EXT:dashboard.
That way widgets of EXT:dashboard can be combined with all providers of this extension.

The concepts are not documented here, check [TYPO3 Dashboard](https://docs.typo3.org/c/typo3/cms-dashboard/main/en-us/Index.html#start) instead.

-   [NewestPageviews](https://docs.typo3.org/permalink/danielsiepmann/tracking:newestpageviews-1@4.1)
-   [PageviewsPerDay](https://docs.typo3.org/permalink/danielsiepmann/tracking:pageviewsperday-1@4.1)
-   [PageviewsPerOperatingSystem](https://docs.typo3.org/permalink/danielsiepmann/tracking:pageviewsperoperatingsystem-1@4.1)
-   [PageviewsPerPage](https://docs.typo3.org/permalink/danielsiepmann/tracking:pageviewsperpage-1@4.1)
