systemSettings = $systemSettings; parent::__construct(); } protected function init() { $this->userTrackingEnabled = $this->createUsersOptOutSetting(); if (!$this->systemSettings->canUserOptOut->getValue()) { // we show this setting only when a user can actually opt out $this->userTrackingEnabled->setIsWritableByCurrentUser(false); } } private function createUsersOptOutSetting() { return $this->makeSetting('userTrackingEnabled', $default = true, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { $field->title = 'Matomo usage tracking enabled'; $field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; $field->description = 'If enabled, anonymous usage data will be tracked. For example which pages are viewed and which reports are used most often. For more information contact your system administrator.'; }); } }