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 :ref:`t3coreapi: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,