typo3 / neos-googleanalytics
Google Analytics integration for Neos CMS
Package info
github.com/neos/neos-googleanalytics
Type:neos-package
pkg:composer/typo3/neos-googleanalytics
Fund package maintenance!
Requires
- neos/fusion-afx: ^9.0
- neos/neos: ^9.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
- typo3/neos-googleanalytics: 4.0.0
- dev-main / 4.0.x-dev
- 4.0.0
- 3.4.x-dev
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.x-dev
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.0.x-dev
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.x-dev
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-task/neos-9-compatibility
This package is auto-updated.
Last update: 2026-10-13 10:09:53 UTC
README
Neos.GoogleAnalytics
This package allows adding Google Analytics and the Google Tag Manager to a Neos CMS website.
Installation
-
Run the following command f.e. in your site package:
composer require --no-update neos/googleanalytics
-
Update your dependencies by running the following command in your project root folder:
composer update
Configuration
Configure tracking
To actually track visits with Google Analytics, some JavaScript with the tracking ID has to be included in the markup. You can do this manually in your template, but the easier way is to set up tracking for each site in the Analytics integration.
Neos: GoogleAnalytics: sites: ## All site specific settings are indexed by site node name neosSiteName: analytics: id: 'G-XXXXXXXXXX'
Instead of using the Google Analytics tracking code, you can integrate the Google Tag Manager the same way:
Neos: GoogleAnalytics: sites: neosSiteName: tagManager: id: 'GTM-XXXXX'
Note: If you configure both, a container and an Analytics ID, only the Tag Manager is included.
It is also possible to define default values for all sites. These will be merged with any site specific settings.
Neos: GoogleAnalytics: default: analytics: id: 'G-XXXXXXXXXX'
Disable tracking
You can disable tracking for a site by either setting the id to false (this is the default value), or leaving it blank.
Neos: GoogleAnalytics: sites: neosSiteName: tagManager: id: false
Additional parameters
If you are using the Google Analytics tracking code, you can also add additional parameters e.g. anonymize_ip set to true.
These parameters are added automatically as JSON to the gtag. The default setting is no parameters.
Neos: GoogleAnalytics: sites: neosSiteName: analytics: id: 'G-XXXXXXXXXX' parameters: anonymize_ip: true
Rendering the tracking code
By default the tracking code is added to the Neos.Neos:Page prototype automatically. If you want to place it
yourself, disable the automatic inclusion and use the Fusion prototypes directly:
Neos: GoogleAnalytics: sites: neosSiteName: addToPagePrototype: false
The following Fusion prototypes are available:
Neos.GoogleAnalytics:TrackingCode.GArenders the gtag.js snippet for the configured Analytics ID.Neos.GoogleAnalytics:TrackingCode.GTM.Scriptrenders the Google Tag Manager script snippet.Neos.GoogleAnalytics:TrackingCode.GTM.NoScriptrenders the Google Tag Manager noscript fallback.Neos.GoogleAnalytics:TrackingCode.GTM.DataLayerpushes the givendataontowindow.dataLayer.
The tracking code is never rendered while working in a non-live workspace, e.g. in the Neos backend.
Upgrade instructions
3.x -> 4.0.0
The statistics display inside the Neos backend (inspector "Stats" tab and the "Analytics" administration module) has been removed, because the underlying Google Analytics Reporting API (Universal Analytics) is no longer available. The package now only provides the tracking code integration.
If you referenced any of these in your own configuration, remove those references.
License
See LICENSE