mirror of
https://github.com/DanielSiepmann/tracking.git
synced 2024-11-14 02:36:08 +01:00
Daniel Siepmann
44ca6a2d3c
Extract operating system from user agent and store it in database record. Another widget is added which displays the page views per operating system. An command is provided which will update existing data.
48 lines
1.7 KiB
YAML
48 lines
1.7 KiB
YAML
imports:
|
|
- { resource: Backend/DashboardWidgets.yaml }
|
|
|
|
services:
|
|
_defaults:
|
|
autowire: true
|
|
autoconfigure: true
|
|
public: false
|
|
|
|
DanielSiepmann\Tracking\:
|
|
resource: '../Classes/*'
|
|
exclude: '../Classes/Dashboard/*'
|
|
|
|
dbconnection.tx_tracking_pageview:
|
|
class: 'TYPO3\CMS\Core\Database\Connection'
|
|
factory:
|
|
- '@TYPO3\CMS\Core\Database\ConnectionPool'
|
|
- 'getConnectionForTable'
|
|
arguments:
|
|
- 'tx_tracking_pageview'
|
|
|
|
querybuilder.tx_tracking_pageview:
|
|
class: 'TYPO3\CMS\Core\Database\Query\QueryBuilder'
|
|
factory:
|
|
- '@TYPO3\CMS\Core\Database\ConnectionPool'
|
|
- 'getQueryBuilderForTable'
|
|
arguments:
|
|
- 'tx_tracking_pageview'
|
|
|
|
DanielSiepmann\Tracking\Domain\Repository\Pageview:
|
|
public: true
|
|
arguments:
|
|
- '@dbconnection.tx_tracking_pageview'
|
|
|
|
DanielSiepmann\Tracking\Middleware\Pageview:
|
|
public: true
|
|
arguments:
|
|
$rule: >
|
|
not (context.getAspect("backend.user").isLoggedIn())
|
|
and not (request.getHeader("User-Agent")[0] matches "/^TYPO3|TYPO3 linkvalidator/")
|
|
and not (request.getHeader("User-Agent")[0] matches "/Wget|curl|Go-http-client/")
|
|
and not (request.getHeader("User-Agent")[0] matches "/Googlebot|Bingbot|bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Sogou|Exabot|NextCloud-News|Feedly|XING FeedReader|CCBot|SemrushBot|SEOkicks|Twitterbot|Seekport Crawler|SemanticScholarBot|ia_archiver|PaperLiBot|TrendsmapResolver|AhrefsBot|Nuzzel/")
|
|
and not (request.getHeader("User-Agent")[0] matches "/mattermost|Slackbot|WhatsApp/")
|
|
|
|
DanielSiepmann\Tracking\Command\UpdateDataCommand:
|
|
tags:
|
|
- name: 'console.command'
|
|
command: 'tracking:updatedata'
|