Analytics gives your site one place to add and manage analytics and tag services, such as Google Tag Manager. Each service you add is listed on one page, where you can configure, reorder, enable or disable it. You can also keep users with a given permission from being tracked, and respect visitors' Do Not Track setting.
To submit bug reports and feature suggestions, or to track changes, use the issue queue.
Requirements
This module requires no modules outside of Drupal core. It requires Drupal 11.3 or later.
Installation
Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.
Configuration
- Give the roles that manage analytics the "Administer analytics" permission at Administration > People > Permissions. Users with it can add JavaScript to every page, so only give it to trusted roles.
- Go to Administration > Configuration > Web services > Analytics services (
/admin/config/services/analytics) and add a service. Pick its type, give it a name, and fill in its settings, such as the container or site ID. - Users with the "Bypass all analytics services" permission aren't tracked. Analytics also never runs on administration pages.
- On the Settings tab, choose whether to respect visitors' Do Not Track setting (on by default).
Included services
- Google Tag Manager: container ID, an optional data layer variable and JSON value, and the anti-flicker snippet for Google Optimize.
- Matomo (formerly Piwik): the URL of your Matomo installation and the site ID. For more Matomo features, such as user ID tracking, use the Matomo Analytics module instead.
Other modules can provide more services as #[AnalyticsService] plugins in src/Plugin/AnalyticsService, extending Drupal\analytics\Plugin\ServicePluginBase. To deprecate a plugin, set the attribute's deprecated property to a deprecation message: the plugin is no longer offered for new services, and services that use it are listed on the status report.
If a service's plugin no longer exists, for example because the module that provided it was uninstalled, the service outputs nothing and is listed on the status report, where it can be edited or deleted.
Maintainers
- Dave Reid - dave reid
Project information
- Project categories: Integrations
206 sites report using this module
- Created by mikey_p on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
Releases
First 2.x beta: Drupal 11.3+ and 12, Matomo service. Uninstall removed submodules on 8.x-1.x first.
Development version: 2.x-dev updated 22 Nov 2026 at 22:53 UTC
Adds a Matomo service and deprecates what 2.x removes. Requires Drupal 11.
Development version: 8.x-1.x-dev updated 22 Nov 2026 at 17:45 UTC



