├── Documentation ├── _build │ └── .gitignore ├── _static │ └── .gitignore ├── _templates │ └── .gitignore ├── Images │ ├── neos-analytics-module.png │ ├── neos-analytics-accounts.png │ ├── neos-analytics-inspector.png │ ├── google-analytics-profile-id.png │ ├── google-developers-console-apis.png │ ├── google-analytics-account-permission.png │ ├── google-developers-console-enable-api.png │ ├── google-developers-console-credentials.png │ ├── google-developers-console-create-project.png │ ├── google-developers-console-service-account.png │ ├── google-developers-console-credentials-done.png │ ├── google-developers-console-project-dashboard.png │ ├── google-developers-console-create-service-account.png │ └── google-developers-console-select-service-accounts.png ├── Makefile ├── index.rst └── conf.py ├── Resources └── Private │ ├── Fusion │ ├── Root.fusion │ ├── Prototypes │ │ ├── TrackingCode.Base.fusion │ │ ├── TrackingCode.GTM.NoScript.fusion │ │ ├── TrackingCode.GTM.DataLayer.fusion │ │ ├── TrackingCode.GTM.Script.fusion │ │ └── TrackingCode.GA.fusion │ └── Override.fusion │ ├── Translations │ ├── pt-PT │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── ta │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── ar │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── cs │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── da │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── el │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── fi │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── fr │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── hu │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── it │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── ja │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── km │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── no │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── pl │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── sr │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── uk │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── vi │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── id_ID │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── sv │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── tl_PH │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── zh │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── zh_TW │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── tr │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── ru │ │ ├── Main.xlf │ │ └── NodeTypes │ │ │ └── StatsTabMixin.xlf │ ├── en │ │ ├── NodeTypes │ │ │ └── StatsTabMixin.xlf │ │ └── Main.xlf │ ├── es │ │ ├── NodeTypes │ │ │ └── StatsTabMixin.xlf │ │ └── Main.xlf │ ├── pt_BR │ │ ├── NodeTypes │ │ │ └── StatsTabMixin.xlf │ │ └── Main.xlf │ ├── de │ │ ├── NodeTypes │ │ │ └── StatsTabMixin.xlf │ │ └── Main.xlf │ ├── lv │ │ ├── NodeTypes │ │ │ └── StatsTabMixin.xlf │ │ └── Main.xlf │ ├── nl │ │ ├── NodeTypes │ │ │ └── StatsTabMixin.xlf │ │ └── Main.xlf │ └── pt │ │ ├── NodeTypes │ │ └── StatsTabMixin.xlf │ │ └── Main.xlf │ └── BackendFusion │ ├── Root.fusion │ ├── Components │ └── FlashMessages.fusion │ └── Views │ └── Configuration.Index.fusion ├── .styleci.yml ├── Configuration ├── Objects.yaml ├── Views.yaml ├── Policy.yaml ├── Settings.yaml └── NodeTypes.yaml ├── Classes ├── Exception.php ├── Exception │ ├── AuthenticationRequiredException.php │ ├── MissingConfigurationException.php │ └── AnalyticsNotAvailableException.php ├── Service │ ├── GoogleAnalytics.php │ ├── DataSource │ │ └── GoogleAnalyticsDataSource.php │ └── Reporting.php ├── Controller │ └── ConfigurationController.php ├── Eel │ └── Helper │ │ └── TrackingConfiguration.php └── Domain │ └── Dto │ └── DataResult.php ├── Migrations ├── Mysql │ ├── Version20141202134558.php │ ├── Version20190607071727.php │ ├── Version20170118172429.php │ └── Version20141111161429.php └── Postgresql │ ├── Version20141202134559.php │ ├── Version20170118172430.php │ ├── Version20190725070956.php │ └── Version20141111161430.php ├── README.md ├── Tests └── Unit │ └── Domain │ └── Dto │ └── DataResultTest.php ├── composer.json └── LICENSE.txt /Documentation/_build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /Documentation/_static/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /Documentation/_templates/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /Resources/Private/Fusion/Root.fusion: -------------------------------------------------------------------------------- 1 | include: **/*.fusion 2 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | preset: psr2 2 | 3 | finder: 4 | path: 5 | - "Classes" 6 | - "Tests" 7 | -------------------------------------------------------------------------------- /Documentation/Images/neos-analytics-module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/neos-analytics-module.png -------------------------------------------------------------------------------- /Documentation/Images/neos-analytics-accounts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/neos-analytics-accounts.png -------------------------------------------------------------------------------- /Documentation/Images/neos-analytics-inspector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/neos-analytics-inspector.png -------------------------------------------------------------------------------- /Documentation/Images/google-analytics-profile-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-analytics-profile-id.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-apis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-apis.png -------------------------------------------------------------------------------- /Documentation/Images/google-analytics-account-permission.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-analytics-account-permission.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-enable-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-enable-api.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-credentials.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-create-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-create-project.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-service-account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-service-account.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-credentials-done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-credentials-done.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-project-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-project-dashboard.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-create-service-account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-create-service-account.png -------------------------------------------------------------------------------- /Documentation/Images/google-developers-console-select-service-accounts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neos/neos-googleanalytics/HEAD/Documentation/Images/google-developers-console-select-service-accounts.png -------------------------------------------------------------------------------- /Configuration/Objects.yaml: -------------------------------------------------------------------------------- 1 | Neos\GoogleAnalytics\Service\GoogleAnalytics: 2 | arguments: 3 | 1: 4 | object: 5 | factoryObjectName: Flowpack\GoogleApiClient\Service\ClientFactory 6 | factoryMethodName: create 7 | -------------------------------------------------------------------------------- /Resources/Private/Translations/pt-PT/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/ta/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/ta/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/pt-PT/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Configuration/Views.yaml: -------------------------------------------------------------------------------- 1 | - 2 | requestFilter: 'isPackage("Neos.GoogleAnalytics") && isController("Configuration")' 3 | viewObjectName: 'Neos\Fusion\View\FusionView' 4 | options: 5 | fusionPathPatterns: 6 | - 'resource://Neos.Fusion/Private/Fusion' 7 | - 'resource://Neos.GoogleAnalytics/Private/BackendFusion' 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/ar/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/cs/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/da/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/el/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/fi/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/fr/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/hu/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/it/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/ja/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/km/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/no/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/pl/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/sr/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/uk/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/vi/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/id_ID/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/sv/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/tl_PH/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/zh/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Translations/zh_TW/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Resources/Private/Fusion/Prototypes/TrackingCode.Base.fusion: -------------------------------------------------------------------------------- 1 | prototype(Neos.GoogleAnalytics:TrackingCode.Base) < prototype(Neos.Fusion:Component) { 2 | # Don't track while in backend 3 | @if.inLiveWorkspace = ${node.context.workspaceName == 'live'} 4 | 5 | configuration = ${Neos.GoogleAnalytics.TrackingConfiguration.setting(site)} 6 | } 7 | -------------------------------------------------------------------------------- /Classes/Exception.php: -------------------------------------------------------------------------------- 1 | '} 6 | } 7 | -------------------------------------------------------------------------------- /Resources/Private/Fusion/Prototypes/TrackingCode.GTM.DataLayer.fusion: -------------------------------------------------------------------------------- 1 | prototype(Neos.GoogleAnalytics:TrackingCode.GTM.DataLayer) < prototype(Neos.Fusion:Component) { 2 | data = Neos.Fusion:DataStructure 3 | @if.hasData = ${Type.isArray(this.data) && !Array.isEmpty(this.data)} 4 | 5 | renderer = Neos.Fusion:Component { 6 | jsonData = ${Json.stringify(props.data)} 7 | renderer = afx` 8 | 11 | ` 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Resources/Private/Translations/tr/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Site 11 | Site 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Classes/Exception/AuthenticationRequiredException.php: -------------------------------------------------------------------------------- 1 | .*Action())' 10 | 11 | roles: 12 | 13 | 'Neos.Neos:Administrator': 14 | privileges: 15 | - 16 | privilegeTarget: 'Neos.GoogleAnalytics:Module.Administration.Configuration' 17 | permission: GRANT 18 | -------------------------------------------------------------------------------- /Resources/Private/Fusion/Prototypes/TrackingCode.GTM.Script.fusion: -------------------------------------------------------------------------------- 1 | prototype(Neos.GoogleAnalytics:TrackingCode.GTM.Script) < prototype(Neos.GoogleAnalytics:TrackingCode.Base) { 2 | containerId = ${this.configuration.tagManager.id} 3 | @if.hasContainerId = ${!String.isBlank(this.containerId)} 4 | 5 | renderer = ${""} 6 | } 7 | -------------------------------------------------------------------------------- /Resources/Private/Translations/ru/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Tracking ID 11 | Tracking ID 12 | 13 | 14 | Tag Manager ID 15 | Tag Manager ID 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Resources/Private/Fusion/Override.fusion: -------------------------------------------------------------------------------- 1 | prototype(Neos.Neos:Page) { 2 | googleTracking = Neos.Fusion:Join { 3 | analytics = Neos.GoogleAnalytics:TrackingCode.GA { 4 | @if.addToPage = ${this.configuration.addToPagePrototype} 5 | } 6 | 7 | tagManagerDataLayer = Neos.GoogleAnalytics:TrackingCode.GTM.DataLayer { 8 | @if.addToPage = ${this.configuration.addToPagePrototype} 9 | } 10 | 11 | tagManager = Neos.GoogleAnalytics:TrackingCode.GTM.Script { 12 | @if.addToPage = ${this.configuration.addToPagePrototype} 13 | } 14 | 15 | @position = 'after headTag 100' 16 | } 17 | 18 | googleTagManagerNoScript = Neos.GoogleAnalytics:TrackingCode.GTM.NoScript { 19 | @if.addToPage = ${this.configuration.addToPagePrototype} 20 | @position = 'before body' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Migrations/Mysql/Version20141202134558.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); 18 | 19 | $this->addSql("ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration ADD trackingid VARCHAR(255) NOT NULL"); 20 | } 21 | 22 | /** 23 | * @param Schema $schema 24 | * @return void 25 | */ 26 | public function down(Schema $schema): void { 27 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); 28 | 29 | $this->addSql("ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration DROP trackingid"); 30 | } 31 | } -------------------------------------------------------------------------------- /Resources/Private/Translations/en/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | 8 | 9 | Analytics 10 | 11 | 12 | Sessions 13 | 14 | 15 | Performance 16 | 17 | 18 | Device categories 19 | 20 | 21 | User types 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Latest Stable Version](https://poser.pugx.org/neos/googleanalytics/v/stable)](https://packagist.org/packages/neos/googleanalytics) 2 | [![Total Downloads](https://poser.pugx.org/neos/googleanalytics/downloads)](https://packagist.org/packages/neos/googleanalytics) 3 | [![License](https://poser.pugx.org/neos/googleanalytics/license)](LICENSE) 4 | 5 | # Neos.GoogleAnalytics 6 | 7 | This package allows adding Google Analytics and the Google Tag Manager to a Neos CMS website. 8 | 9 | You can also view tracking data in the backend for each page. 10 | 11 | Check the [documentation](https://neos-google-analytics-integration.readthedocs.io/en/stable/) for all features and usage. 12 | 13 | ## Installation and usage 14 | 15 | 1. Run the following command f.e. in your site package: 16 | ```bash 17 | composer require --no-update neos/googleanalytics 18 | ``` 19 | 20 | 2. Update your dependencies by running the following command in your project root folder: 21 | ```bash 22 | composer update 23 | ``` 24 | 25 | ## License 26 | 27 | See [LICENSE](./LICENSE.txt) 28 | -------------------------------------------------------------------------------- /Resources/Private/Translations/en/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Authenticated accounts 7 | 8 | 9 | Site 10 | 11 | 12 | Google Analytics Profile 13 | 14 | 15 | Tracking ID 16 | 17 | 18 | Tag Manager ID 19 | 20 | 21 | No accounts were found. Please check the manual on how to connect your account. 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/zh/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | 状态 8 | 9 | Analytics 10 | 分析 11 | 12 | Sessions 13 | 会话 14 | 15 | Performance 16 | 性能 17 | 18 | Device categories 19 | 设备类别 20 | 21 | User types 22 | 用户类型 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/ja/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | 統計 8 | 9 | Analytics 10 | 解析 11 | 12 | Sessions 13 | セッション 14 | 15 | Performance 16 | 性能 17 | 18 | Device categories 19 | デバイスのカテゴリ 20 | 21 | User types 22 | ユーザタイプ 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/zh_TW/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | 統計資訊 8 | 9 | Analytics 10 | 分析 11 | 12 | Sessions 13 | 工作階段 14 | 15 | Performance 16 | 效能 17 | 18 | Device categories 19 | 裝置分類 20 | 21 | User types 22 | 使用者類型 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/ar/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | إحصائيات 8 | 9 | Analytics 10 | تحليلات 11 | 12 | Sessions 13 | الجلسات 14 | 15 | Performance 16 | الأداء 17 | 18 | Device categories 19 | فئات الجهاز 20 | 21 | User types 22 | أنواع المستخدم 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/no/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistikk 8 | 9 | Analytics 10 | Analyser 11 | 12 | Sessions 13 | Økter 14 | 15 | Performance 16 | Ytelse 17 | 18 | Device categories 19 | Enhetskategorier 20 | 21 | User types 22 | Brukertyper 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Classes/Service/GoogleAnalytics.php: -------------------------------------------------------------------------------- 1 | addScope(Google_Service_Analytics::ANALYTICS_READONLY); 36 | } 37 | 38 | /** 39 | * Require an authenticated Google Analytics service 40 | * 41 | * @return GoogleAnalytics The current instance for chaining 42 | * @throws AuthenticationRequiredException 43 | */ 44 | public function requireAuthentication(): GoogleAnalytics 45 | { 46 | return $this; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Migrations/Postgresql/Version20141202134559.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); 27 | 28 | $this->addSql('ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration ADD trackingid VARCHAR(255) NOT NULL'); 29 | } 30 | 31 | /** 32 | * @param Schema $schema 33 | * @return void 34 | */ 35 | public function down(Schema $schema): void 36 | { 37 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); 38 | 39 | $this->addSql('ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration DROP trackingid'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Resources/Private/Translations/cs/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistiky 8 | 9 | Analytics 10 | Analytika 11 | 12 | Sessions 13 | Relace 14 | 15 | Performance 16 | Výkon 17 | 18 | Device categories 19 | Kategorie zařízení 20 | 21 | User types 22 | Typy uživatelů 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/id_ID/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistik 8 | 9 | Analytics 10 | Analitis 11 | 12 | Sessions 13 | Sesi 14 | 15 | Performance 16 | Performa 17 | 18 | Device categories 19 | Kategori perangkat 20 | 21 | User types 22 | Jenis pengguna 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/sv/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistik 8 | 9 | Analytics 10 | Analys 11 | 12 | Sessions 13 | Sessioner 14 | 15 | Performance 16 | Prestanda 17 | 18 | Device categories 19 | Enhetskategorier 20 | 21 | User types 22 | Användartyper 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/el/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Στατιστικά 8 | 9 | Analytics 10 | Analytics 11 | 12 | Sessions 13 | Συνεδρίες 14 | 15 | Performance 16 | Απόδοση 17 | 18 | Device categories 19 | Κατηγορίες συσκευών 20 | 21 | User types 22 | Τύποι χρηστών 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/sr/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Статистика 8 | 9 | Analytics 10 | Аналитика 11 | 12 | Sessions 13 | Сесије 14 | 15 | Performance 16 | Перформансе 17 | 18 | Device categories 19 | Категорије уређаја 20 | 21 | User types 22 | Типови корисника 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/vi/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Số liệu thống kê 8 | 9 | Analytics 10 | Phân tích 11 | 12 | Sessions 13 | Phiên 14 | 15 | Performance 16 | Hiệu suất 17 | 18 | Device categories 19 | Danh mục thiết bị 20 | 21 | User types 22 | Loại người dùng 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/hu/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statisztika 8 | 9 | Analytics 10 | Analízis 11 | 12 | Sessions 13 | Munkamenetek 14 | 15 | Performance 16 | Teljesítmény 17 | 18 | Device categories 19 | Eszköz-kategóriák 20 | 21 | User types 22 | Felhasználói típusok 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/it/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistiche 8 | 9 | Analytics 10 | Analitica 11 | 12 | Sessions 13 | Sessioni 14 | 15 | Performance 16 | Prestazioni 17 | 18 | Device categories 19 | Categorie di dispositivi 20 | 21 | User types 22 | Tipi di utente 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/es/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Estadísticas 8 | 9 | Analytics 10 | Analítica 11 | 12 | Sessions 13 | Sesiones 14 | 15 | Performance 16 | Rendimiento 17 | 18 | Device categories 19 | Categorías de dispositivos 20 | 21 | User types 22 | Tipos de usuario 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/pt_BR/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Estatísticas 8 | 9 | Analytics 10 | Análises 11 | 12 | Sessions 13 | Sessões 14 | 15 | Performance 16 | Performance 17 | 18 | Device categories 19 | Categorias de dispositivos 20 | 21 | User types 22 | Tipos de usuário 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/uk/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | статистика 8 | 9 | Analytics 10 | Аналітика 11 | 12 | Sessions 13 | Sessions 14 | 15 | Performance 16 | Performance 17 | 18 | Device categories 19 | Device categories 20 | 21 | User types 22 | User types 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/tl_PH/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Stats 8 | 9 | Analytics 10 | Analytics 11 | 12 | Sessions 13 | Sessions 14 | 15 | Performance 16 | Performance 17 | 18 | Device categories 19 | Device categories 20 | 21 | User types 22 | User types 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/da/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistik 8 | 9 | Analytics 10 | Analytics 11 | 12 | Sessions 13 | Sessioner 14 | 15 | Performance 16 | Ydeevne 17 | 18 | Device categories 19 | Enhedskategorier 20 | 21 | User types 22 | Brugertyper 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/de/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistiken 8 | 9 | Analytics 10 | Analytics 11 | 12 | Sessions 13 | Sitzungen 14 | 15 | Performance 16 | Leistung 17 | 18 | Device categories 19 | Geräteklassen 20 | 21 | User types 22 | Nutzertypen 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/km/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | ស្ថិតិ 8 | 9 | Analytics 10 | វិភាគ 11 | 12 | Sessions 13 | កំឡុងពេល 14 | 15 | Performance 16 | ការសម្ដែង 17 | 18 | Device categories 19 | ប្រភេទឧបករណ៍ 20 | 21 | User types 22 | ប្រភេទអ្នកប្រើប្រាស់ 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/fi/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Tilastot 8 | 9 | Analytics 10 | Analytiikka 11 | 12 | Sessions 13 | Istunnot 14 | 15 | Performance 16 | Suorituskyky 17 | 18 | Device categories 19 | Laitekategoriat 20 | 21 | User types 22 | Käyttäjätyypit 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/lv/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistika 8 | 9 | Analytics 10 | Analīze 11 | 12 | Sessions 13 | Sesijas 14 | 15 | Performance 16 | Veiktspēja 17 | 18 | Device categories 19 | Ierīces kategorijas 20 | 21 | User types 22 | Lietotāja tipi 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/nl/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistieken 8 | 9 | Analytics 10 | Analytics 11 | 12 | Sessions 13 | Sessies 14 | 15 | Performance 16 | Prestatie 17 | 18 | Device categories 19 | Apparaatcategorieën 20 | 21 | User types 22 | Gebruikerstypes 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/pl/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statystyki 8 | 9 | Analytics 10 | Analityki 11 | 12 | Sessions 13 | Sesje 14 | 15 | Performance 16 | Wydajność 17 | 18 | Device categories 19 | Kategorie urządzeń 20 | 21 | User types 22 | Typy użytkownika 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/ru/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Статистика 8 | 9 | Analytics 10 | Аналитика 11 | 12 | Sessions 13 | Сеансы 14 | 15 | Performance 16 | Производительность 17 | 18 | Device categories 19 | Типы устройств 20 | 21 | User types 22 | Типы пользователей 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/fr/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Statistiques 8 | 9 | Analytics 10 | Analyses d'audience 11 | 12 | Sessions 13 | Sessions 14 | 15 | Performance 16 | Performance 17 | 18 | Device categories 19 | Catégories d'appareil 20 | 21 | User types 22 | Types d'utilisateurs 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/tr/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | İstatistikler 8 | 9 | Analytics 10 | Analizleri görmek için tıklayınız 11 | 12 | Sessions 13 | Oturumları görmek için tıklayınız 14 | 15 | Performance 16 | Performansı görmek için tıklayınız 17 | 18 | Device categories 19 | Cihaz kategorileri 20 | 21 | User types 22 | Kullanıcı türleri görmek için tıklayınız 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Resources/Private/Translations/pt/NodeTypes/StatsTabMixin.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stats 7 | Estatísticas 8 | 9 | 10 | Analytics 11 | Analise 12 | 13 | 14 | Sessions 15 | Sessões 16 | 17 | 18 | Performance 19 | Rendimento 20 | 21 | 22 | Device categories 23 | Categorias de dispositivos 24 | 25 | 26 | User types 27 | Tipos de utilizador 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Tests/Unit/Domain/Dto/DataResultTest.php: -------------------------------------------------------------------------------- 1 | setColumnHeaders([ 26 | ['name' => 'ga:userType', 'columnType' => 'DIMENSION'], 27 | ['name' => 'ga:sessions', 'columnType' => 'METRIC'] 28 | ]); 29 | $data->setTotalsForAllResults([ 30 | 'ga:sessions' => 0 31 | ]); 32 | $data->setRows([ 33 | [0, 0] 34 | ]); 35 | 36 | $result = new DataResult($data); 37 | $serializableValue = $result->jsonSerialize(); 38 | 39 | $this->assertArrayHasKey('rows', $serializableValue); 40 | $this->assertArrayHasKey(0, $serializableValue['rows']); 41 | $this->assertArrayHasKey('percent', $serializableValue['rows'][0]); 42 | $this->assertSame(0, $serializableValue['rows'][0]['percent'], 'Value for rows.0.percent should match'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Migrations/Postgresql/Version20170118172430.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); 24 | 25 | $this->addSql('ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration RENAME TO neos_googleanalytics_domain_model_siteconfiguration'); 26 | $this->addSql('ALTER INDEX idx_d675f674694309e4 RENAME TO idx_dacc5fd9694309e4'); 27 | } 28 | 29 | /** 30 | * @param Schema $schema 31 | * @return void 32 | */ 33 | public function down(Schema $schema): void 34 | { 35 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); 36 | 37 | $this->addSql('ALTER TABLE neos_googleanalytics_domain_model_siteconfiguration RENAME TO typo3_neos_googleanalytics_domain_model_siteconfiguration'); 38 | $this->addSql('ALTER INDEX idx_dacc5fd9694309e4 RENAME TO idx_d675f674694309e4'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Resources/Private/Translations/pt_BR/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Authenticated accounts 11 | Contas autenticadas 12 | 13 | 14 | Google Analytics Profile 15 | Perfil Google Analytics 16 | 17 | 18 | Tracking ID 19 | ID de Rastreio 20 | 21 | 22 | Tag Manager ID 23 | ID do Gerenciador de Tags 24 | 25 | 26 | No accounts were found. Please check the manual on how to connect your account. 27 | Nenhuma conta foi encontrada. Consulte o manual para saber como conectar sua conta. 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Resources/Private/BackendFusion/Components/FlashMessages.fusion: -------------------------------------------------------------------------------- 1 | prototype(Neos.GoogleAnalytics:Component.FlashMessages) < prototype(Neos.Fusion:Component) { 2 | flashMessages = ${[]} 3 | @if.hasMessages = ${Type.isArray(this.flashMessages) && Array.length(this.flashMessages)} 4 | 5 | renderer = afx` 6 |
7 | 8 | 9 | 10 |
11 | ` 12 | } 13 | 14 | prototype(Neos.GoogleAnalytics:Component.FlashMessages.Message) < prototype(Neos.Fusion:Component) { 15 | message = ${{}} 16 | 17 | severity = ${String.toLowerCase(this.message.severity)} 18 | severity.@process.replaceOKStatus = ${value == 'ok' ? 'success' : value} 19 | severity.@process.replaceNoticeStatus = ${value == 'notice' ? 'info' : value} 20 | 21 | renderer = afx` 22 |
23 |
24 | 25 |
26 | {props.message.title} 27 |
28 |
{props.message.message}
29 |
30 |
31 | ` 32 | } 33 | -------------------------------------------------------------------------------- /Resources/Private/Translations/nl/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Authenticated accounts 11 | Geauthenticeerde accounts 12 | 13 | 14 | Google Analytics Profile 15 | Google Analytics profiel 16 | 17 | 18 | Tracking ID 19 | Tracking ID 20 | 21 | 22 | Tag Manager ID 23 | Tag Manager ID 24 | 25 | 26 | No accounts were found. Please check the manual on how to connect your account. 27 | Geen accounts gevonden. Controleer de handleiding om te zien hoe u uw account kan verbinden. 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Resources/Private/Translations/lv/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Authenticated accounts 11 | Autentificētie konti 12 | 13 | 14 | Tracking ID 15 | Izsekošanas ID 16 | 17 | 18 | Tag Manager ID 19 | Tagu pārvaldnieka ID 20 | 21 | 22 | Google Analytics Profile 23 | Google Analytics profils 24 | 25 | 26 | No accounts were found. Please check the manual on how to connect your account. 27 | Konti netika atrasti. Lūdzu, skatiet lietošanas pamācību, lai uzzinātu, kā pieslēgt kontu. 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Resources/Private/Fusion/Prototypes/TrackingCode.GA.fusion: -------------------------------------------------------------------------------- 1 | prototype(Neos.GoogleAnalytics:TrackingCode.GA) < prototype(Neos.GoogleAnalytics:TrackingCode.Base) { 2 | trackingId = ${this.configuration.analytics.id} 3 | 4 | @if { 5 | hasTrackingId = ${!String.isBlank(this.trackingId)} 6 | hasNoContainerId = ${String.isBlank(this.configuration.tagManager.id)} 7 | } 8 | 9 | parameters = ${this.configuration.analytics.parameters} 10 | parameters.@process.json = ${Json.stringify(value)} 11 | 12 | renderer = Neos.Fusion:Component { 13 | trackingId = ${props.trackingId} 14 | 15 | # Actual tracking code JavaScript snippets, can be extended with additional lines 16 | code = Neos.Fusion:Join { 17 | create = 'window.dataLayer = window.dataLayer || [];' 18 | push = 'function gtag(){dataLayer.push(arguments);}' 19 | date = 'gtag("js", new Date());' 20 | config = Neos.Fusion:Case { 21 | hasParameters { 22 | condition = ${props.parameters && props.parameters != 'null' && props.parameters != '[]'} 23 | renderer = ${'gtag("config", "' + props.trackingId + '", ' + props.parameters + ');'} 24 | } 25 | default { 26 | condition = true 27 | renderer = ${'gtag("config", "' + props.trackingId + '");'} 28 | } 29 | } 30 | } 31 | 32 | renderer = afx` 33 | 34 | 35 | ` 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Resources/Private/Translations/pt/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Site 11 | Site 12 | 13 | 14 | Authenticated accounts 15 | Contas autenticadas 16 | 17 | 18 | Google Analytics Profile 19 | Perfil do Google Analytics 20 | 21 | 22 | Tracking ID 23 | ID de Seguimento 24 | 25 | 26 | Tag Manager ID 27 | ID do Gestor de Etiquetas 28 | 29 | 30 | No accounts were found. Please check the manual on how to connect your account. 31 | Nenhuma conta encontrada. Por favor verifique o manual para saber como conectar a sua conta. 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Resources/Private/Translations/de/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Tracking ID 11 | Tracking ID 12 | 13 | 14 | Tag Manager ID 15 | Tag Manager ID 16 | 17 | 18 | Site 19 | Site 20 | 21 | 22 | No accounts were found. Please check the manual on how to connect your account. 23 | Es wurden keine Konten gefunden. Bitte lesen Sie im Handbuch nach, wie Sie Ihr Konto verbinden können. 24 | 25 | 26 | Authenticated accounts 27 | Authentifizierte Konten 28 | 29 | 30 | Google Analytics Profile 31 | Google Analytics Profil 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Resources/Private/Translations/es/Main.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Tracking ID 11 | Identificador de seguimiento 12 | 13 | 14 | Tag Manager ID 15 | Identificador del administrador de etiquetas 16 | 17 | 18 | Site 19 | Página web 20 | 21 | 22 | Authenticated accounts 23 | Cuentas autenticadas 24 | 25 | 26 | Google Analytics Profile 27 | Perfil de Google Analytics 28 | 29 | 30 | No accounts were found. Please check the manual on how to connect your account. 31 | No se ha encontrado ninguna cuenta. Consulta el manual para saber cómo conectar tu cuenta. 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Migrations/Postgresql/Version20190725070956.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); 26 | 27 | $this->addSql('DROP TABLE neos_googleanalytics_domain_model_siteconfiguration'); 28 | } 29 | 30 | /** 31 | * @param Schema $schema 32 | * @return void 33 | */ 34 | public function down(Schema $schema): void 35 | { 36 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on "postgresql".'); 37 | 38 | $this->addSql('CREATE TABLE neos_googleanalytics_domain_model_siteconfiguration (persistence_object_identifier VARCHAR(40) NOT NULL, site VARCHAR(40) DEFAULT NULL, profileid VARCHAR(255) NOT NULL, trackingid VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier))'); 39 | $this->addSql('CREATE INDEX idx_dacc5fd9694309e4 ON neos_googleanalytics_domain_model_siteconfiguration (site)'); 40 | $this->addSql('ALTER TABLE neos_googleanalytics_domain_model_siteconfiguration ADD CONSTRAINT fk_d675f674694309e4 FOREIGN KEY (site) REFERENCES neos_neos_domain_model_site (persistence_object_identifier) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Migrations/Mysql/Version20190607071727.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); 25 | 26 | $this->addSql('DROP TABLE neos_googleanalytics_domain_model_siteconfiguration'); 27 | } 28 | 29 | /** 30 | * @param Schema $schema 31 | * @return void 32 | */ 33 | public function down(Schema $schema): void 34 | { 35 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); 36 | 37 | $this->addSql('CREATE TABLE neos_googleanalytics_domain_model_siteconfiguration (persistence_object_identifier VARCHAR(40) NOT NULL COLLATE utf8_unicode_ci, site VARCHAR(40) DEFAULT NULL COLLATE utf8_unicode_ci, profileid VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, trackingid VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, INDEX IDX_D675F674694309E4 (site), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' '); 38 | $this->addSql('ALTER TABLE neos_googleanalytics_domain_model_siteconfiguration ADD CONSTRAINT FK_DACC5FD9694309E4 FOREIGN KEY (site) REFERENCES neos_neos_domain_model_site (persistence_object_identifier) ON DELETE CASCADE'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Configuration/Settings.yaml: -------------------------------------------------------------------------------- 1 | Neos: 2 | Fusion: 3 | defaultContext: 4 | 'Neos.GoogleAnalytics.TrackingConfiguration': 'Neos\GoogleAnalytics\Eel\Helper\TrackingConfiguration' 5 | Neos: 6 | userInterface: 7 | requireJsPathMapping: 8 | 'Neos.GoogleAnalytics/Inspector/Editors': 'resource://Neos.GoogleAnalytics/Public/Scripts/Inspector/Editors' 9 | translation: 10 | autoInclude: 11 | 'Neos.GoogleAnalytics': ['NodeTypes/*'] 12 | 13 | modules: 14 | administration: 15 | submodules: 16 | googleAnalytics: 17 | label: 'Analytics' 18 | controller: 'Neos\GoogleAnalytics\Controller\ConfigurationController' 19 | description: 'Google Analytics configuration' 20 | icon: 'icon-chart-line icon-line-chart' 21 | privilegeTarget: 'Neos.GoogleAnalytics:Module.Administration.Configuration' 22 | 23 | fusion: 24 | autoInclude: 25 | 'Neos.GoogleAnalytics': true 26 | 27 | GoogleAnalytics: 28 | stats: 29 | uniquePageviewsPerDay: 30 | metrics: 'ga:uniquePageviews' 31 | dimensions: 'ga:date' 32 | basic: 33 | metrics: 'ga:pageviews,ga:uniquePageviews,ga:users' 34 | uniquePageviewsByUserType: 35 | metrics: 'ga:uniquePageviews' 36 | dimensions: 'ga:userType' 37 | uniquePageviewsByDeviceCategory: 38 | metrics: 'ga:uniquePageviews' 39 | dimensions: 'ga:deviceCategory' 40 | 41 | # Default settings 42 | default: 43 | addToPagePrototype: true 44 | overrideHostname: '' 45 | analytics: 46 | id: false 47 | parameters: # define additional GA paramters here e.g. IP anonymization 48 | # anonymize_ip: true 49 | tagManager: 50 | id: false 51 | 52 | # Site specific settings 53 | sites: [] 54 | ## All site specific settings are indexed by site node name 55 | # 56 | # neosdemo: 57 | # addToPagePrototype: false 58 | # pagePathPrefix: 'www.example.org' 59 | # includePagePath: false 60 | # profileId: '12345678' 61 | # analytics: 62 | # id: 'UA-XXXXX-YY' 63 | # tagManager: 64 | # id: GTM-XXXXX 65 | 66 | -------------------------------------------------------------------------------- /Classes/Controller/ConfigurationController.php: -------------------------------------------------------------------------------- 1 | analytics->getClient(); 57 | $managementAccounts = $this->analytics->management_accounts->listManagementAccounts(); 58 | 59 | if (!is_array($managementAccounts)) { 60 | $managementAccounts = [$managementAccounts]; 61 | } 62 | } catch (Google_Service_Exception $e) { 63 | foreach ($e->getErrors() as $error) { 64 | $this->addFlashMessage('', $error['message'], Message::SEVERITY_ERROR); 65 | } 66 | } 67 | 68 | $this->view->assignMultiple([ 69 | 'sitesConfiguration' => $this->settings['sites'], 70 | 'managementAccounts' => $managementAccounts, 71 | 'flashMessages' => $this->controllerContext->getFlashMessageContainer()->getMessagesAndFlush(), 72 | ]); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Classes/Eel/Helper/TrackingConfiguration.php: -------------------------------------------------------------------------------- 1 | defaultSettings; 52 | 53 | $nodeName = null; 54 | if ($site instanceof NodeInterface) { 55 | $nodeName = $site->getNodeName(); 56 | } 57 | 58 | if ($nodeName instanceof NodeName && isset($this->sitesSettings[(string)$nodeName])) { 59 | $settings = Arrays::arrayMergeRecursiveOverrule($this->defaultSettings, $this->sitesSettings[(string)$nodeName]); 60 | } 61 | 62 | if ($path === null) { 63 | return $settings; 64 | } 65 | 66 | return Arrays::getValueByPath($settings, $path); 67 | } 68 | 69 | /** 70 | * @param string $methodName 71 | * @return bool 72 | */ 73 | public function allowsCallOfMethod($methodName): bool 74 | { 75 | return true; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Classes/Service/DataSource/GoogleAnalyticsDataSource.php: -------------------------------------------------------------------------------- 1 | ['message' => 'Invalid date format for argument "startDate"', 'code' => 1417435564]]; 54 | } 55 | try { 56 | $endDate = new DateTime($endDateArgument); 57 | } catch (\Exception $exception) { 58 | return ['error' => ['message' => 'Invalid date format for argument "endDate"', 'code' => 1417435581]]; 59 | } 60 | try { 61 | $stats = $this->reporting->getNodeStat($node, $this->controllerContext, $arguments['stat'], $startDate, $endDate); 62 | $data = [ 63 | 'data' => $stats 64 | ]; 65 | 66 | return $data; 67 | } catch (Exception $exception) { 68 | return [ 69 | 'error' => [ 70 | 'message' => $exception->getMessage(), 71 | 'code' => $exception->getCode() 72 | ] 73 | ]; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Migrations/Postgresql/Version20141111161430.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); 18 | 19 | $this->addSql("CREATE TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration (persistence_object_identifier VARCHAR(40) NOT NULL, site VARCHAR(40) DEFAULT NULL, profileid VARCHAR(255) NOT NULL, PRIMARY KEY(persistence_object_identifier))"); 20 | $this->addSql("CREATE INDEX IDX_D675F674694309E4 ON typo3_neos_googleanalytics_domain_model_siteconfiguration (site)"); 21 | /** 22 | * We need to check what the name of the site table is. If you install Neos, run migrations, then add this package, 23 | * then run this package's migrations, the name will will be neos_flow_... 24 | * However, if you install everything in one go and run migrations then, the order will be different because this migration 25 | * comes before the Flow migration where the table is renamed (Version20161124185047). So we need to check which of these two 26 | * tables exist and set the FK relation accordingly. 27 | **/ 28 | if ($this->sm->tablesExist('neos_neos_domain_model_site')) { 29 | // "neos_" table is there - this means flow migrations have already been run. 30 | $this->addSql("ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration ADD CONSTRAINT FK_D675F674694309E4 FOREIGN KEY (site) REFERENCES neos_neos_domain_model_site (persistence_object_identifier) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE"); 31 | } else if ($this->sm->tablesExist('typo3_neos_domain_model_site')) { 32 | // Flow migrations have not been run fully yet, table still has the old name. 33 | $this->addSql("ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration ADD CONSTRAINT FK_D675F674694309E4 FOREIGN KEY (site) REFERENCES typo3_neos_domain_model_site (persistence_object_identifier) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE"); 34 | } 35 | } 36 | 37 | /** 38 | * @param Schema $schema 39 | * @return void 40 | */ 41 | public function down(Schema $schema): void { 42 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql"); 43 | 44 | $this->addSql("DROP TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Resources/Private/BackendFusion/Views/Configuration.Index.fusion: -------------------------------------------------------------------------------- 1 | prototype(Neos.GoogleAnalytics:Configuration.Index) < prototype(Neos.Fusion:Component) { 2 | sites = ${[]} 3 | flashMessages = ${[]} 4 | managementAccounts = ${[]} 5 | 6 | renderer = afx` 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 28 | 29 | 30 |
{Translation.translate('Neos.GoogleAnalytics:Main:accounts', 'Authenticated accounts')}
19 |
    20 | 21 |
  • {account.username}
  • 22 |
    23 |
  • 24 | {Translation.translate('Neos.GoogleAnalytics:Main:noAccounts', 'No accounts were found. Please check the manual on how to connect your account.')} 25 |
  • 26 |
27 |
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
{Translation.translate('Neos.GoogleAnalytics:Main:site.name', 'Site')}{Translation.translate('Neos.GoogleAnalytics:Main:site. gaProfile', 'Google Analytics Profile')}{Translation.translate('Neos.GoogleAnalytics:Main:site.gaTrackingId', 'Tracking ID')}{Translation.translate('Neos.GoogleAnalytics:Main:site.tagManagerId', 'Tag Manager ID')}
{siteName}{site.profileId}{site.analytics.id}{site.tagManager.id}
52 |
53 | ` 54 | } 55 | -------------------------------------------------------------------------------- /Migrations/Mysql/Version20170118172429.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); 24 | 25 | $this->addSql('RENAME TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration TO neos_googleanalytics_domain_model_siteconfiguration'); 26 | 27 | // Renaming of indexes is only possible with MySQL version 5.7+ 28 | if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { 29 | $this->addSql('ALTER TABLE neos_googleanalytics_domain_model_siteconfiguration RENAME INDEX FK_D675F674694309E4 TO FK_DACC5FD9694309E4'); 30 | } else { 31 | $this->addSql('ALTER TABLE neos_googleanalytics_domain_model_siteconfiguration DROP FOREIGN KEY FK_D675F674694309E4'); 32 | $this->addSql('ALTER TABLE neos_googleanalytics_domain_model_siteconfiguration ADD CONSTRAINT FK_DACC5FD9694309E4 FOREIGN KEY (site) REFERENCES neos_neos_domain_model_site (persistence_object_identifier) ON DELETE CASCADE'); 33 | } 34 | } 35 | 36 | /** 37 | * @param Schema $schema 38 | * @return void 39 | */ 40 | public function down(Schema $schema): void 41 | { 42 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".'); 43 | 44 | $this->addSql('RENAME TABLE neos_googleanalytics_domain_model_siteconfiguration TO typo3_neos_googleanalytics_domain_model_siteconfiguration'); 45 | 46 | // Renaming of indexes is only possible with MySQL version 5.7+ 47 | if ($this->connection->getDatabasePlatform() instanceof MySQL57Platform) { 48 | $this->addSql('ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration RENAME INDEX FK_DACC5FD9694309E4 TO FK_D675F674694309E4'); 49 | } else { 50 | $this->addSql('ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration DROP FOREIGN KEY FK_DACC5FD9694309E4'); 51 | $this->addSql('ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration ADD CONSTRAINT FK_D675F674694309E4 FOREIGN KEY (site) REFERENCES neos_neos_domain_model_site (persistence_object_identifier) ON DELETE CASCADE'); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Classes/Domain/Dto/DataResult.php: -------------------------------------------------------------------------------- 1 | result = $result; 32 | } 33 | 34 | /** 35 | * {@inheritdoc} 36 | */ 37 | public function jsonSerialize() 38 | { 39 | $totals = $this->result->getTotalsForAllResults(); 40 | 41 | $sanitizedTotals = []; 42 | foreach ($totals as $key => $value) { 43 | $replacedKey = str_replace(':', '_', $key); 44 | $sanitizedTotals[$replacedKey] = $value; 45 | } 46 | $columnHeaders = $this->result->getColumnHeaders(); 47 | foreach ($columnHeaders as &$columnHeader) { 48 | $columnHeader['name'] = str_replace(':', '_', $columnHeader['name']); 49 | } 50 | $rows = $this->result->getRows(); 51 | if (!is_array($rows)) { 52 | $rows = []; 53 | } 54 | $sanitizedRows = []; 55 | foreach ($rows as $rowIndex => $row) { 56 | foreach ($row as $columnIndex => $columnValue) { 57 | $columnName = $columnHeaders[$columnIndex]['name']; 58 | if ($columnName === 'ga_date') { 59 | $columnValue = substr($columnValue, 0, 4) . '-' . substr($columnValue, 4, 2) . '-' . substr($columnValue, 6, 2); 60 | } 61 | $sanitizedRows[$rowIndex][$columnName] = $columnValue; 62 | } 63 | // The simple case that we have 2 columns with 1 dimension and 1 metric 64 | if (count($columnHeaders) == 2 && $columnHeaders[0]['columnType'] === 'DIMENSION' && $columnHeaders[1]['columnType'] === 'METRIC') { 65 | $sanitizedTotal = $sanitizedTotals[$columnHeaders[1]['name']]; 66 | if ($sanitizedTotal > 0) { 67 | $sanitizedRows[$rowIndex]['percent'] = round($row[1] / $sanitizedTotal * 100, 2); 68 | } else { 69 | $sanitizedRows[$rowIndex]['percent'] = 0; 70 | } 71 | } 72 | } 73 | 74 | return [ 75 | 'totals' => $sanitizedTotals, 76 | 'rows' => $sanitizedRows 77 | ]; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Migrations/Mysql/Version20141111161429.php: -------------------------------------------------------------------------------- 1 | abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); 18 | /** 19 | * With the new version of NEOS the recommended database charset is utf8mb4 and not just utf8 anymore. 20 | * To make the foreign key constraint work the table/cell encoding must match the 21 | * encoding of typo3_neos_domain_model_site / neos_domain_model_site. 22 | * Solution: First check encoding of typo3_neos_domain_model_site / neos_domain_model_site, 23 | * then create neos_googleanalytics_domain_model_siteconfiguration accordingly. 24 | * AND 25 | * We need to check what the name of the site table is. If you install Neos, run migrations, then add this package, 26 | * then run this package's migrations, the name will will be neos_flow_... 27 | * However, if you install everything in one go and run migrations then, the order will be different because this migration 28 | * comes before the Flow migration where the table is renamed (Version20161124185047). So we need to check which of these two 29 | * tables exist and set the FK relation accordingly. 30 | **/ 31 | 32 | if ($this->sm->tablesExist('neos_neos_domain_model_site')) { 33 | $tableName = 'neos_neos_domain_model_site'; 34 | } elseif ($this->sm->tablesExist('typo3_neos_domain_model_site')) { 35 | $tableName = 'typo3_neos_domain_model_site'; 36 | } else { 37 | return; // Nothing to do here 38 | } 39 | 40 | // the column name can come out of the query as upper or lower case 41 | // (see https://github.com/neos/neos-googleanalytics/pull/70 and 42 | // https://github.com/neos/neos-googleanalytics/issues/72 for details) 43 | // - thus the AS is added. 44 | $columnCharSets = $this->connection->executeQuery("SELECT character_set_name AS charsetname FROM information_schema.`COLUMNS` WHERE table_schema IN (SELECT DATABASE()) AND table_name = '${tableName}' AND column_name = 'persistence_object_identifier'")->fetch(); 45 | $charSet = $columnCharSets['charsetname']; 46 | 47 | $this->addSql("CREATE TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration (persistence_object_identifier VARCHAR(40) NOT NULL, site VARCHAR(40) DEFAULT NULL, profileid VARCHAR(255) NOT NULL, INDEX IDX_D675F674694309E4 (site), PRIMARY KEY(persistence_object_identifier)) DEFAULT CHARACTER SET ${charSet} COLLATE ${charSet}_unicode_ci ENGINE = InnoDB"); 48 | $this->addSql("ALTER TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration ADD CONSTRAINT FK_D675F674694309E4 FOREIGN KEY (site) REFERENCES ${tableName} (persistence_object_identifier) ON DELETE CASCADE"); 49 | } 50 | 51 | /** 52 | * @param Schema $schema 53 | * @return void 54 | */ 55 | public function down(Schema $schema): void { 56 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); 57 | 58 | $this->addSql("DROP TABLE typo3_neos_googleanalytics_domain_model_siteconfiguration"); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Configuration/NodeTypes.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Add the Google Analytics mixin to Neos.Neos:Document 3 | # 4 | #'Neos.Neos:Document': 5 | # superTypes: 6 | # 'Neos.GoogleAnalytics:StatsTabMixin': false 7 | 8 | #'Neos.Neos:Shortcut': 9 | # superTypes: 10 | # 'Neos.GoogleAnalytics:StatsTabMixin': false 11 | 12 | # 13 | # Mixin configuring the Analytics tab for the inspector 14 | # 15 | 'Neos.GoogleAnalytics:StatsTabMixin': 16 | abstract: true 17 | # ui: 18 | # inspector: 19 | # tabs: 20 | # stats: 21 | # label: 'Neos.GoogleAnalytics:NodeTypes.StatsTabMixin:tabs.stats' 22 | # position: 100 23 | # icon: 'icon-line-chart icon-chart-line' 24 | # groups: 25 | # analytics: 26 | # label: 'Neos.GoogleAnalytics:NodeTypes.StatsTabMixin:groups.analytics' 27 | # icon: 'icon-line-chart' 28 | # position: 10 29 | # tab: 'stats' 30 | # # All analytics metrics are "views" for the inspector 31 | # # 32 | # # Stats for the GoogleAnalytics data source are configured in Settings.yaml. 33 | # views: 34 | # gaUniquePageviewsPerDay: 35 | # label: 'Neos.GoogleAnalytics:NodeTypes.StatsTabMixin:views.gaUniquePageviewsPerDay' 36 | # group: 'analytics' 37 | # position: 10 38 | # view: 'Content/Inspector/Views/Data/TimeSeriesView' 39 | # viewOptions: 40 | # subtitle: '3 months' 41 | # dataSource: 'GoogleAnalytics' 42 | # arguments: 43 | # stat: 'uniquePageviewsPerDay' 44 | # startDate: '3 months ago' 45 | # endDate: '1 day ago' 46 | # collection: 'rows' 47 | # series: 48 | # timeData: 'ga_date' 49 | # valueData: 'ga_uniquePageviews' 50 | # chart: 51 | # selectedInterval: 'months' 52 | # gaBasic: 53 | # label: 'Neos.GoogleAnalytics:NodeTypes.StatsTabMixin:views.gaBasic' 54 | # group: 'analytics' 55 | # position: 20 56 | # view: 'Content/Inspector/Views/Data/ColumnView' 57 | # viewOptions: 58 | # dataSource: 'GoogleAnalytics' 59 | # arguments: 60 | # stat: 'basic' 61 | # startDate: '3 months ago' 62 | # endDate: '1 day ago' 63 | # hero: 64 | # data: 'totals.ga_uniquePageviews' 65 | # label: 'Sessions' 66 | # columns: 67 | # - 68 | # data: 'totals.ga_pageviews' 69 | # label: 'Pageviews' 70 | # - 71 | # data: 'totals.ga_users' 72 | # label: 'Users' 73 | # gaUniquePageviewsByDeviceCategory: 74 | # label: 'Neos.GoogleAnalytics:NodeTypes.StatsTabMixin:views.gaUniquePageviewsByDeviceCategory' 75 | # group: 'analytics' 76 | # position: 30 77 | # view: 'Content/Inspector/Views/Data/TableView' 78 | # viewOptions: 79 | # dataSource: 'GoogleAnalytics' 80 | # arguments: 81 | # stat: 'uniquePageviewsByDeviceCategory' 82 | # startDate: '3 months ago' 83 | # endDate: '1 day ago' 84 | # collection: 'rows' 85 | # columns: 86 | # - 87 | # data: 'ga_deviceCategory' 88 | # iconMap: 89 | # desktop: 'icon-desktop' 90 | # tablet: 'icon-tablet' 91 | # mobile: 'icon-mobile-phone' 92 | # - 93 | # data: 'ga_uniquePageviews' 94 | # - 95 | # data: 'percent' 96 | # suffix: '%' 97 | # gaUniquePageviewsByUserType: 98 | # label: 'Neos.GoogleAnalytics:NodeTypes.StatsTabMixin:views.gaUniquePageviewsByUserType' 99 | # group: 'analytics' 100 | # position: 40 101 | # view: 'Content/Inspector/Views/Data/TableView' 102 | # viewOptions: 103 | # dataSource: 'GoogleAnalytics' 104 | # arguments: 105 | # stat: 'uniquePageviewsByUserType' 106 | # startDate: '3 months ago' 107 | # endDate: '1 day ago' 108 | # collection: 'rows' 109 | # columns: 110 | # - 111 | # data: 'ga_userType' 112 | # iconMap: 113 | # 'New Visitor': 'icon-plus' 114 | # 'Returning Visitor': 'icon-refresh' 115 | # - 116 | # data: 'ga_uniquePageviews' 117 | # - 118 | # data: 'percent' 119 | # suffix: '%' 120 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "neos/googleanalytics", 3 | "type": "neos-package", 4 | "description": "Google Analytics integration for Neos CMS", 5 | "license": "GPL-3.0-or-later", 6 | "require": { 7 | "neos/neos": "^7.0 || ^8.0 || dev-master", 8 | "neos/fusion-afx": "^7.0 || ^8.0", 9 | "flowpack/googleapiclient": "^1.0", 10 | "guzzlehttp/psr7": "^1.4 || ^2.0", 11 | "ext-json": "*" 12 | }, 13 | "replace": { 14 | "typo3/neos-googleanalytics": "self.version" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "Neos\\GoogleAnalytics\\": "Classes" 19 | } 20 | }, 21 | "extra": { 22 | "branch-alias": { 23 | "dev-master": "2.0.x-dev" 24 | }, 25 | "applied-flow-migrations": [ 26 | "TYPO3.FLOW3-201201261636", 27 | "TYPO3.Fluid-201205031303", 28 | "TYPO3.FLOW3-201205292145", 29 | "TYPO3.FLOW3-201206271128", 30 | "TYPO3.FLOW3-201209201112", 31 | "TYPO3.Flow-201209251426", 32 | "TYPO3.Flow-201211151101", 33 | "TYPO3.Flow-201212051340", 34 | "TYPO3.TypoScript-130516234520", 35 | "TYPO3.TypoScript-130516235550", 36 | "TYPO3.TYPO3CR-130523180140", 37 | "TYPO3.Neos.NodeTypes-201309111655", 38 | "TYPO3.Flow-201310031523", 39 | "TYPO3.Flow-201405111147", 40 | "TYPO3.Neos-201407061038", 41 | "TYPO3.Neos-201409071922", 42 | "TYPO3.TYPO3CR-140911160326", 43 | "TYPO3.Neos-201410010000", 44 | "TYPO3.TYPO3CR-141101082142", 45 | "TYPO3.Neos-20141113115300", 46 | "TYPO3.Fluid-20141113120800", 47 | "TYPO3.Flow-20141113121400", 48 | "TYPO3.Fluid-20141121091700", 49 | "TYPO3.Neos-20141218134700", 50 | "TYPO3.Fluid-20150214130800", 51 | "TYPO3.Neos-20150303231600", 52 | "TYPO3.TYPO3CR-20150510103823", 53 | "TYPO3.Flow-20151113161300", 54 | "TYPO3.Flow-20161115140400", 55 | "TYPO3.Flow-20161115140430", 56 | "Neos.Flow-20161124204700", 57 | "Neos.Flow-20161124204701", 58 | "Neos.Twitter.Bootstrap-20161124204912", 59 | "Neos.Flow-20161124224015", 60 | "Neos.Party-20161124225257", 61 | "Neos.Eel-20161124230101", 62 | "Neos.Setup-20161124230842", 63 | "Neos.Imagine-20161124231742", 64 | "Neos.Media-20161124233100", 65 | "Neos.NodeTypes-20161125002300", 66 | "Neos.Neos-20161125002322", 67 | "Neos.ContentRepository-20161125012000", 68 | "Neos.Fusion-20161125013710", 69 | "Neos.Setup-20161125014759", 70 | "Neos.Fusion-20161125104701", 71 | "Neos.NodeTypes-20161125104800", 72 | "Neos.Neos-20161125104802", 73 | "Neos.Neos-20161125122412", 74 | "Neos.Flow-20161125124112", 75 | "Neos.SwiftMailer-20161130105617", 76 | "TYPO3.FluidAdaptor-20161130112935", 77 | "Neos.Fusion-20161201202543", 78 | "Neos.Neos-20161201222211", 79 | "Neos.Fusion-20161202215034", 80 | "Neos.Fusion-20161219092345", 81 | "Neos.ContentRepository-20161219093512", 82 | "Neos.Media-20161219094126", 83 | "Neos.Neos-20161219094403", 84 | "Neos.Neos-20161219122512", 85 | "Neos.Fusion-20161219130100", 86 | "Neos.Neos-20161220163741", 87 | "TYPO3.Form-20160601101500", 88 | "Neos.Form-20161124205254", 89 | "Neos.Kickstart-20161124230102", 90 | "Neos.SiteKickstarter-20161125002311", 91 | "Neos.SiteKickstarter-20161125095901", 92 | "Neos.Kickstarter-20161125110814", 93 | "Neos.Neos-20170115114620", 94 | "Neos.Fusion-20170120013047", 95 | "Neos.Flow-20170125103800", 96 | "Neos.Seo-20170127154600", 97 | "Neos.Flow-20170127183102", 98 | "Neos.Fusion-20180211175500", 99 | "Neos.Fusion-20180211184832", 100 | "Neos.Flow-20180415105700", 101 | "Neos.Neos-20180907103800", 102 | "Neos.Neos.Ui-20190319094900", 103 | "Neos.Flow-20190425144900", 104 | "Neos.Flow-20190515215000", 105 | "Neos.NodeTypes-20190917101945", 106 | "Neos.NodeTypes-20200120114136", 107 | "Neos.Flow-20200813181400", 108 | "Neos.Flow-20201003165200", 109 | "Neos.Flow-20201109224100", 110 | "Neos.Flow-20201205172733", 111 | "Neos.Flow-20201207104500" 112 | ] 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Classes/Service/Reporting.php: -------------------------------------------------------------------------------- 1 | analytics->requireAuthentication(); 96 | if (!isset($this->statsSettings[$statIdentifier])) { 97 | throw new \InvalidArgumentException(sprintf('Unknown stat identifier "%s"', $statIdentifier), 1416917316); 98 | } 99 | $statConfiguration = $this->statsSettings[$statIdentifier]; 100 | $siteConfiguration = $this->getSiteConfigurationByNode($node); 101 | 102 | $startDateFormatted = $startDate->format('Y-m-d'); 103 | $endDateFormatted = $endDate->format('Y-m-d'); 104 | 105 | $nodeUri = $this->getLiveNodeUri($node, $controllerContext); 106 | $hostname = !empty($siteConfiguration['overrideHostname']) ? $siteConfiguration['overrideHostname'] : $nodeUri->getHost(); 107 | $pagePathPrefix = $siteConfiguration['pagePathPrefix'] ?? ''; 108 | $includePagePath = !isset($siteConfiguration['includePagePath']) || $siteConfiguration['includePagePath']; 109 | 110 | $filters = 'ga:hostname==' . $hostname; 111 | if ($includePagePath) { 112 | $filters .= ';ga:pagePath==' . $pagePathPrefix . $nodeUri->getPath(); 113 | } 114 | $parameters = [ 115 | 'filters' => $filters 116 | ]; 117 | if (isset($statConfiguration['dimensions'])) { 118 | $parameters['dimensions'] = $statConfiguration['dimensions']; 119 | } 120 | if (isset($statConfiguration['sort'])) { 121 | $parameters['sort'] = $statConfiguration['sort']; 122 | } 123 | if (isset($statConfiguration['max-results'])) { 124 | $parameters['max-results'] = $statConfiguration['max-results']; 125 | } 126 | $gaResult = $this->analytics->data_ga->get( 127 | 'ga:' . $siteConfiguration['profileId'], 128 | $startDateFormatted, 129 | $endDateFormatted, 130 | $statConfiguration['metrics'], 131 | $parameters 132 | ); 133 | 134 | return new DataResult($gaResult); 135 | } 136 | 137 | /** 138 | * Get a site configuration (which has a Google Analytics profile id) for the given node 139 | * 140 | * @param NodeInterface $node 141 | * @return array 142 | * @throws MissingConfigurationException If no site configuration was found, or the profile was not assigned 143 | */ 144 | protected function getSiteConfigurationByNode(NodeInterface $node): array 145 | { 146 | $context = $node->getContext(); 147 | if (!$context instanceof ContentContext) { 148 | throw new \InvalidArgumentException(sprintf('Expected a ContentContext instance in the given node, got %s', get_class($context)), 1415722633); 149 | } 150 | $site = $context->getCurrentSite(); 151 | if (array_key_exists($site->getNodeName(), $this->sitesSettings)) { 152 | $siteConfiguration = Arrays::arrayMergeRecursiveOverrule($this->defaultSettings, $this->sitesSettings[$site->getNodeName()]); 153 | 154 | if (array_key_exists('profileId', $siteConfiguration) && !empty($siteConfiguration['profileId'])) { 155 | return $siteConfiguration; 156 | } 157 | } 158 | throw new MissingConfigurationException('No profile configured for site ' . $site->getName(), 1415806282); 159 | } 160 | 161 | /** 162 | * Resolve an URI for the given node in the live workspace (this is where analytics usually are collected) 163 | * 164 | * @param NodeInterface $node 165 | * @param ControllerContext $controllerContext 166 | * @return Uri 167 | * @throws AnalyticsNotAvailableException If the node was not yet published and no live workspace URI can be resolved 168 | * @throws MissingActionNameException 169 | * @throws PropertyException 170 | * @throws SecurityException 171 | * @throws NeosException 172 | */ 173 | protected function getLiveNodeUri(NodeInterface $node, ControllerContext $controllerContext): Uri 174 | { 175 | $contextProperties = $node->getContext()->getProperties(); 176 | $contextProperties['workspaceName'] = 'live'; 177 | $liveContext = $this->contextFactory->create($contextProperties); 178 | $liveNode = $liveContext->getNodeByIdentifier($node->getIdentifier()); 179 | 180 | if ($liveNode === null) { 181 | throw new AnalyticsNotAvailableException('Analytics are only available on a published node', 1417450159); 182 | } 183 | 184 | $nodeUriString = $this->linkingService->createNodeUri($controllerContext, $liveNode, null, 'html', true); 185 | $nodeUri = new Uri($nodeUriString); 186 | 187 | return $nodeUri; 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /Documentation/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " applehelp to make an Apple Help Book" 34 | @echo " devhelp to make HTML files and a Devhelp project" 35 | @echo " epub to make an epub" 36 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 37 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 38 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 39 | @echo " text to make text files" 40 | @echo " man to make manual pages" 41 | @echo " texinfo to make Texinfo files" 42 | @echo " info to make Texinfo files and run them through makeinfo" 43 | @echo " gettext to make PO message catalogs" 44 | @echo " changes to make an overview of all changed/added/deprecated items" 45 | @echo " xml to make Docutils-native XML files" 46 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 47 | @echo " linkcheck to check all external links for integrity" 48 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 49 | @echo " coverage to run coverage check of the documentation (if enabled)" 50 | 51 | clean: 52 | rm -rf $(BUILDDIR)/* 53 | 54 | html: 55 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 56 | @echo 57 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 58 | 59 | dirhtml: 60 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 61 | @echo 62 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 63 | 64 | singlehtml: 65 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 66 | @echo 67 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 68 | 69 | pickle: 70 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 71 | @echo 72 | @echo "Build finished; now you can process the pickle files." 73 | 74 | json: 75 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 76 | @echo 77 | @echo "Build finished; now you can process the JSON files." 78 | 79 | htmlhelp: 80 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 81 | @echo 82 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 83 | ".hhp project file in $(BUILDDIR)/htmlhelp." 84 | 85 | qthelp: 86 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 87 | @echo 88 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 89 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 90 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/NeosCMS.qhcp" 91 | @echo "To view the help file:" 92 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/NeosCMS.qhc" 93 | 94 | applehelp: 95 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 96 | @echo 97 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 98 | @echo "N.B. You won't be able to view it unless you put it in" \ 99 | "~/Library/Documentation/Help or install it in your application" \ 100 | "bundle." 101 | 102 | devhelp: 103 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 104 | @echo 105 | @echo "Build finished." 106 | @echo "To view the help file:" 107 | @echo "# mkdir -p $$HOME/.local/share/devhelp/NeosCMS" 108 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/NeosCMS" 109 | @echo "# devhelp" 110 | 111 | epub: 112 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 113 | @echo 114 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 115 | 116 | latex: 117 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 118 | @echo 119 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 120 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 121 | "(use \`make latexpdf' here to do that automatically)." 122 | 123 | latexpdf: 124 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 125 | @echo "Running LaTeX files through pdflatex..." 126 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 127 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 128 | 129 | latexpdfja: 130 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 131 | @echo "Running LaTeX files through platex and dvipdfmx..." 132 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 133 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 134 | 135 | text: 136 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 137 | @echo 138 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 139 | 140 | man: 141 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 142 | @echo 143 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 144 | 145 | texinfo: 146 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 147 | @echo 148 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 149 | @echo "Run \`make' in that directory to run these through makeinfo" \ 150 | "(use \`make info' here to do that automatically)." 151 | 152 | info: 153 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 154 | @echo "Running Texinfo files through makeinfo..." 155 | make -C $(BUILDDIR)/texinfo info 156 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 157 | 158 | gettext: 159 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 160 | @echo 161 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 162 | 163 | changes: 164 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 165 | @echo 166 | @echo "The overview file is in $(BUILDDIR)/changes." 167 | 168 | linkcheck: 169 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 170 | @echo 171 | @echo "Link check complete; look for any errors in the above output " \ 172 | "or in $(BUILDDIR)/linkcheck/output.txt." 173 | 174 | doctest: 175 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 176 | @echo "Testing of doctests in the sources finished, look at the " \ 177 | "results in $(BUILDDIR)/doctest/output.txt." 178 | 179 | coverage: 180 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 181 | @echo "Testing of coverage in the sources finished, look at the " \ 182 | "results in $(BUILDDIR)/coverage/python.txt." 183 | 184 | xml: 185 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 186 | @echo 187 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 188 | 189 | pseudoxml: 190 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 191 | @echo 192 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 193 | -------------------------------------------------------------------------------- /Documentation/index.rst: -------------------------------------------------------------------------------- 1 | Neos Google Analytics |version| Documentation 2 | ============================================= 3 | 4 | This is the documentation for the Google Analytics integration into Neos, 5 | a free enterprise web content management system licensed under the GPL. 6 | 7 | This version of the documentation covering |release| has been rendered at: |today| 8 | 9 | Installation 10 | ------------ 11 | 12 | The package can be installed via composer in your site package:: 13 | 14 | composer require --no-update neos/googleanalytics 15 | 16 | Then run `composer update` in your projects root directory. 17 | 18 | Configuration 19 | ------------- 20 | 21 | Configure tracking 22 | ^^^^^^^^^^^^^^^^^^ 23 | 24 | To actually track visits with Google Analytics, some JavaScript with the tracking ID has to be 25 | included in the markup. You can do this manually in your template, but the easier way is 26 | to set up tracking for each site in the Analytics integration. 27 | 28 | .. code-block:: yaml 29 | 30 | Neos: 31 | GoogleAnalytics: 32 | sites: 33 | ## All site specific settings are indexed by site node name 34 | neosSiteName: 35 | analytics: 36 | id: 'UA-XXXXX-YY' 37 | 38 | The Google Analytics tracking also supports additional parameters, f.e. to anonymize ips. 39 | You can define them like this: 40 | 41 | .. code-block:: yaml 42 | 43 | Neos: 44 | GoogleAnalytics: 45 | sites: 46 | neosSiteName: 47 | analytics: 48 | id: 'UA-XXXXX-YY' 49 | parameters: 50 | anonymize_ip: true 51 | 52 | Instead of using the Google Analytics tracking code, you can integrate the Google Tag Manager the same way: 53 | 54 | .. code-block:: yaml 55 | 56 | Neos: 57 | GoogleAnalytics: 58 | sites: 59 | neosSiteName: 60 | tagManager: 61 | id: 'GTM-XXXXX' 62 | 63 | .. note:: 64 | If you configure both, a container and an Analytics ID, only the Tag Manager is included. 65 | 66 | It is also possible to define default values for all sites. These will be merged with any site specific settings. 67 | 68 | .. code-block:: yaml 69 | 70 | Neos: 71 | GoogleAnalytics: 72 | default: 73 | analytics: 74 | id: 'UA-XXXXX-YY' 75 | 76 | The analytics backend module will also give you and overview of all configured sites and their ids. 77 | 78 | Disable tracking 79 | ---------------- 80 | 81 | You can disable tracking for a site by either setting the ``id `` to ``false `` (this is the default value), or leaving it blank. 82 | 83 | .. code-block:: yaml 84 | 85 | Neos: 86 | GoogleAnalytics: 87 | sites: 88 | neosSiteName: 89 | tagManager: 90 | id: false 91 | 92 | Additional Parameters 93 | --------------------- 94 | 95 | If you are using the Google Analytics tracking code, you can also add additional parameters e.g. ``authorize_ip `` to ``true `` (`IP anonymization with gtag.js `_). These paramters are added automatically as JSON to the gtag. The default setting is no parameters. 96 | 97 | .. code-block:: yaml 98 | 99 | Neos: 100 | GoogleAnalytics: 101 | sites: 102 | neosSiteName: 103 | analytics: 104 | id: 'UA-XXXXX-YY' 105 | parameters: 106 | anonymize_ip: true 107 | 108 | Statistics display inside Neos 109 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 110 | 111 | Configuration requires some setup on the side of Google, before the package can be used. 112 | In a nutshell: 113 | 114 | #. Log in to the Google Developers Console 115 | #. Create a service account key 116 | #. Enable the Analytics API 117 | #. Give the service account permissions to your analytics account 118 | #. Configure the Google Analytics Neos integration using the created credentials 119 | 120 | **The steps in detail** 121 | 122 | Go to the `Google Developers Console `_ and create 123 | a project. This is needed to create the API credentials and keys for the Analytics 124 | integration. The project name can be chosen freely and doesn't really matter, as you will 125 | probably be the only one to ever see it. 126 | 127 | .. image:: Images/google-developers-console-create-project.png 128 | 129 | After the project has been created, you end up in the dashboard of the new project. 130 | 131 | .. image:: Images/google-developers-console-project-dashboard.png 132 | 133 | If you don't have one yet you have to create a new service account. For this go to "Service accounts" in the sidebar: 134 | 135 | .. image:: Images/google-developers-console-select-service-accounts.png 136 | 137 | Now create a new one and fill out the required information: 138 | 139 | .. image:: Images/google-developers-console-create-service-account.png 140 | 141 | Now give the account the `Viewer` role for the project. 142 | 143 | Now you need to create credentials for the integration. To do this, click on *Credentials* in the 144 | navigation, then *Create credentials* > "Service account key*. 145 | 146 | .. image:: Images/google-developers-console-credentials.png 147 | 148 | Here you need to choose your service account and select `json` as key type: 149 | 150 | .. image:: Images/google-developers-console-service-account.png 151 | 152 | Then click *Create*. The download of your credentials file should start immediately. 153 | 154 | Your credentials overview should now look like this: 155 | 156 | .. image:: Images/google-developers-console-credentials-done.png 157 | 158 | The last step in the Developers Console is to make sure the Google Analytics API is enabled. 159 | Click on *Library* in the left navigation and enter "Analytics" in the search field. 160 | 161 | .. image:: Images/google-developers-console-apis.png 162 | 163 | Click on the Analytics API link and on the following page on Enable. 164 | 165 | .. image:: Images/google-developers-console-enable-api.png 166 | 167 | To allow the service account to access your analytics data you have to give it the necessary permissions. 168 | For that log into Google Analytics and go to the `Admin` menu on the bottom left. 169 | Then select `User Management` and add the email address of your service account as a new user with 170 | the read & analyze permission. 171 | 172 | .. image:: Images/google-analytics-account-permission.png 173 | 174 | Copy the profile id (visible as view id) from your analytics account and add it to your sites settings in 175 | your `Settings.yaml`. 176 | 177 | .. image:: Images/google-analytics-profile-id.png 178 | 179 | The configuration should then look like this:: 180 | 181 | Neos: 182 | GoogleAnalytics: 183 | sites: 184 | neosSiteName: 185 | analytics: 186 | id: 'UA-XXXXX-YY' 187 | profileId: 123456789 188 | 189 | With the credentials file you downloaded before you can now configure Neos. 190 | You can either do this by storing the credentials in the persistent cache with the following command:: 191 | 192 | flow googleapi:storecredentials my-credentials-file.json 193 | 194 | Or you can set the environment variable `GOOGLE_APPLICATION_CREDENTIALS` 195 | to the path where you store your credentials file. 196 | 197 | Now go to the Analytics module in the Neos user interface and verify your setup. 198 | 199 | .. image:: Images/neos-analytics-module.png 200 | 201 | .. image:: Images/neos-analytics-accounts.png 202 | 203 | Now the integration is set up to fetch data and display the Analytics statistics in the Neos 204 | user interface. 205 | 206 | Usage 207 | ----- 208 | 209 | If Google has collected statistical data for your site and you configured the statistics display, 210 | you will get the most important data shown in an inspector tab for documents: 211 | 212 | .. image:: Images/neos-analytics-inspector.png 213 | 214 | Customizing metrics display 215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 216 | 217 | Its is possible to adjust the displayed metrics through configuration. The package 218 | comes with preconfigured data, examine ``NodeTypes.yaml`` and ``Settings.yaml``. 219 | 220 | Showing metrics in non-live environments 221 | ---------------------------------------- 222 | 223 | The configuration allows to override the hostname that is used for statistics queries. 224 | By default the hostname is used that Neos provides based on the selected pages frontend uri. 225 | This can be used to verify the functionality of the statistics module during development 226 | or in staging environments. 227 | Additionally, there is a setting for prepending a string to the frontend uri. The frontend uri 228 | is automatically created. 229 | 230 | .. code-block:: yaml 231 | 232 | Neos: 233 | GoogleAnalytics: 234 | sites: 235 | neosSiteName: 236 | overrideHostname: 'example.org' 237 | pagePathPrefix: '/neosuri' 238 | 239 | Show only page information 240 | ---------------------------------------- 241 | 242 | To show the information for the whole site and not only the current page, 243 | the setting 'includePagePath' can be set. This removes the filter for the frontend uri from 244 | the API request. 245 | 246 | .. code-block:: yaml 247 | 248 | Neos: 249 | GoogleAnalytics: 250 | sites: 251 | neosSiteName: 252 | includePagePath: false 253 | 254 | 255 | Upgrade instructions (2.x -> 3.0.0) 256 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 257 | 258 | Configuration for the tracking code has been changed: 259 | 260 | .. code-block:: yaml 261 | 262 | Neos: 263 | GoogleAnalytics: 264 | sites: 265 | neosSiteName: 266 | analytics: 267 | id: 'UA-XXXXX-YY' 268 | 269 | ``enableTracking`` setting 270 | -------------------------- 271 | 272 | Tracking code is now only included if you provide either a container or an Analytics ID. 273 | The ``enableTracking`` setting has therefore been removed. 274 | 275 | Authentication with the Google API 276 | ---------------------------------- 277 | 278 | The OAuth authentication in the older version of this package was often unreliable and caused many issues. 279 | 280 | Therefore you now need to create a service account and matching credentials. See the `Configuration` chapter above. 281 | -------------------------------------------------------------------------------- /Documentation/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Neos Google Analytics documentation build configuration file. 4 | # 5 | # This file is execfile()d with the current directory set to its 6 | # containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys 15 | import os 16 | import shlex 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | #sys.path.insert(0, os.path.abspath('.')) 22 | 23 | # -- General configuration ------------------------------------------------ 24 | 25 | # If your documentation needs a minimal Sphinx version, state it here. 26 | #needs_sphinx = '1.0' 27 | 28 | # Add any Sphinx extension module names here, as strings. They can be 29 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 30 | # ones. 31 | extensions = [ 32 | 'sphinx.ext.intersphinx', 33 | 'sphinx.ext.todo', 34 | 'sphinx.ext.ifconfig' 35 | ] 36 | 37 | # Add any paths that contain templates here, relative to this directory. 38 | templates_path = ['_templates'] 39 | 40 | # The suffix(es) of source filenames. 41 | # You can specify multiple suffix as a list of string: 42 | # source_suffix = ['.rst', '.md'] 43 | source_suffix = '.rst' 44 | 45 | # The encoding of source files. 46 | #source_encoding = 'utf-8-sig' 47 | 48 | # The master toctree document. 49 | master_doc = 'index' 50 | 51 | # General information about the project. 52 | project = u'Neos Google Analytics Integration' 53 | copyright = u'2014 and onwards by the authors' 54 | author = u'Neos Team and Contributors' 55 | 56 | # The version info for the project you're documenting, acts as replacement for 57 | # |version| and |release|, also used in various other places throughout the 58 | # built documents. 59 | # 60 | # The short X.Y version. 61 | version = 'dev-master' 62 | # The full version, including alpha/beta/rc tags. 63 | release = 'dev-master' 64 | 65 | # The language for content autogenerated by Sphinx. Refer to documentation 66 | # for a list of supported languages. 67 | # 68 | # This is also used if you do content translation via gettext catalogs. 69 | # Usually you set "language" from the command line for these cases. 70 | language = None 71 | 72 | # There are two options for replacing |today|: either, you set today to some 73 | # non-false value, then it is used: 74 | #today = '' 75 | # Else, today_fmt is used as the format for a strftime call. 76 | #today_fmt = '%B %d, %Y' 77 | 78 | # List of patterns, relative to source directory, that match files and 79 | # directories to ignore when looking for source files. 80 | exclude_patterns = ['_build'] 81 | 82 | # The reST default role (used for this markup: `text`) to use for all 83 | # documents. 84 | #default_role = None 85 | 86 | # If true, '()' will be appended to :func: etc. cross-reference text. 87 | #add_function_parentheses = True 88 | 89 | # If true, the current module name will be prepended to all description 90 | # unit titles (such as .. function::). 91 | #add_module_names = True 92 | 93 | # If true, sectionauthor and moduleauthor directives will be shown in the 94 | # output. They are ignored by default. 95 | #show_authors = False 96 | 97 | # The name of the Pygments (syntax highlighting) style to use. 98 | pygments_style = 'sphinx' 99 | 100 | # A list of ignored prefixes for module index sorting. 101 | #modindex_common_prefix = [] 102 | 103 | # If true, keep warnings as "system message" paragraphs in the built documents. 104 | #keep_warnings = False 105 | 106 | # If true, `todo` and `todoList` produce output, else they produce nothing. 107 | todo_include_todos = False 108 | 109 | 110 | # -- Options for HTML output ---------------------------------------------- 111 | 112 | # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org 113 | on_rtd = os.environ.get('READTHEDOCS', None) == 'True' 114 | 115 | if not on_rtd: # only import and set the theme if we're building docs locally 116 | import sphinx_rtd_theme 117 | html_theme = 'sphinx_rtd_theme' 118 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] 119 | 120 | # otherwise, readthedocs.org uses their theme by default, so no need to specify it 121 | 122 | # The theme to use for HTML and HTML Help pages. See the documentation for 123 | # a list of builtin themes. 124 | # html_theme = 'alabaster' 125 | 126 | # Theme options are theme-specific and customize the look and feel of a theme 127 | # further. For a list of options available for each theme, see the 128 | # documentation. 129 | #html_theme_options = {} 130 | 131 | # Add any paths that contain custom themes here, relative to this directory. 132 | #html_theme_path = [] 133 | 134 | # The name for this set of Sphinx documents. If None, it defaults to 135 | # " v documentation". 136 | #html_title = None 137 | 138 | # A shorter title for the navigation bar. Default is the same as html_title. 139 | #html_short_title = None 140 | 141 | # The name of an image file (relative to this directory) to place at the top 142 | # of the sidebar. 143 | #html_logo = None 144 | 145 | # The name of an image file (within the static path) to use as favicon of the 146 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 147 | # pixels large. 148 | #html_favicon = None 149 | 150 | # Add any paths that contain custom static files (such as style sheets) here, 151 | # relative to this directory. They are copied after the builtin static files, 152 | # so a file named "default.css" will overwrite the builtin "default.css". 153 | html_static_path = ['_static'] 154 | 155 | # Add any extra paths that contain custom files (such as robots.txt or 156 | # .htaccess) here, relative to this directory. These files are copied 157 | # directly to the root of the documentation. 158 | #html_extra_path = [] 159 | 160 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 161 | # using the given strftime format. 162 | #html_last_updated_fmt = '%b %d, %Y' 163 | 164 | # If true, SmartyPants will be used to convert quotes and dashes to 165 | # typographically correct entities. 166 | #html_use_smartypants = True 167 | 168 | # Custom sidebar templates, maps document names to template names. 169 | #html_sidebars = {} 170 | 171 | # Additional templates that should be rendered to pages, maps page names to 172 | # template names. 173 | #html_additional_pages = {} 174 | 175 | # If false, no module index is generated. 176 | #html_domain_indices = True 177 | 178 | # If false, no index is generated. 179 | #html_use_index = True 180 | 181 | # If true, the index is split into individual pages for each letter. 182 | #html_split_index = False 183 | 184 | # If true, links to the reST sources are added to the pages. 185 | #html_show_sourcelink = True 186 | 187 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 188 | #html_show_sphinx = True 189 | 190 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 191 | #html_show_copyright = True 192 | 193 | # If true, an OpenSearch description file will be output, and all pages will 194 | # contain a tag referring to it. The value of this option must be the 195 | # base URL from which the finished HTML is served. 196 | #html_use_opensearch = '' 197 | 198 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 199 | #html_file_suffix = None 200 | 201 | # Language to be used for generating the HTML full-text search index. 202 | # Sphinx supports the following languages: 203 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' 204 | # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' 205 | #html_search_language = 'en' 206 | 207 | # A dictionary with options for the search language support, empty by default. 208 | # Now only 'ja' uses this config value 209 | #html_search_options = {'type': 'default'} 210 | 211 | # The name of a javascript file (relative to the configuration directory) that 212 | # implements a search results scorer. If empty, the default will be used. 213 | #html_search_scorer = 'scorer.js' 214 | 215 | # Output file base name for HTML help builder. 216 | htmlhelp_basename = 'NeosGAdoc' 217 | 218 | # -- Options for LaTeX output --------------------------------------------- 219 | 220 | latex_elements = { 221 | # The paper size ('letterpaper' or 'a4paper'). 222 | 'papersize': 'a4paper', 223 | 224 | # The font size ('10pt', '11pt' or '12pt'). 225 | 'pointsize': '10pt', 226 | 227 | # Additional stuff for the LaTeX preamble. 228 | #'preamble': '', 229 | 230 | # Latex figure (float) alignment 231 | #'figure_align': 'htbp', 232 | } 233 | 234 | # Grouping the document tree into LaTeX files. List of tuples 235 | # (source start file, target name, title, 236 | # author, documentclass [howto, manual, or own class]). 237 | latex_documents = [ 238 | (master_doc, 'NeosGAdoc.tex', u'Neos Google Analytics Integration', 239 | u'The Neos Team', 'manual'), 240 | ] 241 | 242 | # The name of an image file (relative to this directory) to place at the top of 243 | # the title page. 244 | #latex_logo = None 245 | 246 | # For "manual" documents, if this is true, then toplevel headings are parts, 247 | # not chapters. 248 | #latex_use_parts = False 249 | 250 | # If true, show page references after internal links. 251 | #latex_show_pagerefs = False 252 | 253 | # If true, show URL addresses after external links. 254 | #latex_show_urls = False 255 | 256 | # Documents to append as an appendix to all manuals. 257 | #latex_appendices = [] 258 | 259 | # If false, no module index is generated. 260 | #latex_domain_indices = True 261 | 262 | 263 | # -- Options for manual page output --------------------------------------- 264 | 265 | # One entry per manual page. List of tuples 266 | # (source start file, name, description, authors, manual section). 267 | man_pages = [ 268 | (master_doc, 'neosga', u'Neos Google Analytics Integration', 269 | [author], 1) 270 | ] 271 | 272 | # If true, show URL addresses after external links. 273 | #man_show_urls = False 274 | 275 | 276 | # -- Options for Texinfo output ------------------------------------------- 277 | 278 | # Grouping the document tree into Texinfo files. List of tuples 279 | # (source start file, target name, title, author, 280 | # dir menu entry, description, category) 281 | texinfo_documents = [ 282 | (master_doc, 'NeosGA', u'Neos Google Analytics Integration', 283 | author, 'NeosGA', 'Integrates Google Analytics in Neos CMS', 284 | 'Miscellaneous'), 285 | ] 286 | 287 | # Documents to append as an appendix to all manuals. 288 | #texinfo_appendices = [] 289 | 290 | # If false, no module index is generated. 291 | #texinfo_domain_indices = True 292 | 293 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 294 | #texinfo_show_urls = 'footnote' 295 | 296 | # If true, do not generate a @detailmenu in the "Top" node's menu. 297 | #texinfo_no_detailmenu = False 298 | 299 | 300 | # Example configuration for intersphinx: refer to the Python standard library. 301 | intersphinx_mapping = {'https://docs.python.org/': None} 302 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------