Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

GA4 Dashboard

No security coverage Under active development

GA4 Dashboard shows your site's Google Analytics 4 figures in Drupal's administration pages: visitors, page views, the most visited pages, where visits come from, devices, cities and languages, with charts. It can also add the tag that counts page views. No dependencies beyond Drupal core: no Google library, no chart library, nothing loaded from a CDN.

Editors and site owners see how the site is doing without signing in to Google Analytics, and the reports follow the administration theme, including right-to-left languages.

Features

  • A dashboard at Reports » Analytics over the last 7, 28 or 90 days, each figure compared with the period before:
    • Visitors now (the last 30 minutes), visitors, new visitors, visits, page views, time on the site per visitor and engaged visits.
    • Visitors and page views by day, as a chart and as a table.
    • The ten most visited pages, where visits come from, devices, cities, and page views in each of the site's languages.
  • Charts drawn on the server as SVG, with a table behind each for screen readers. They follow the administration theme's colors (Gin's, in light and dark mode, where Gin is used) and run right to left on right-to-left sites.
  • Two blocks: the whole dashboard, for example as a tab of the Dashboard module, and a summary with the headline figures and a link to the full dashboard.
  • The tag, optional. Google's gtag snippet from a file, so it works under a strict Content Security Policy and a consent tool such as Klaro! can hold it back. Page views only, with Google signals and ad personalization off. It never runs on administration or account pages, and by default it only counts visitors who are not logged in.
  • The service account key is never stored in the database. It is uploaded on the settings page and written to the private files directory, readable by the web server only. Saving tests the connection, and every change is logged, without the key.
  • Light on Google's quota: a period is fetched in two batch requests and cached for an hour; visitors now are cached for a minute.
  • Read-only: the dashboard only reads whole-site figures from Google's Analytics Data API. No visitor is named.
  • For developers: hook_ga4_dashboard_report_alter() changes the figures before they are shown, for example to name cities in the site's languages.

Post-Installation

  1. In Google Analytics, note the property's measurement ID (G-XXXXXXXXXX, under Admin » Data streams) and its property ID (digits, under Admin » Property details).
  2. In the Google Cloud console, enable the Google Analytics Data API, create a service account and download a JSON key for it.
  3. In Google Analytics, under Admin » Property access management, add the service account's email with the Viewer role.
  4. In Drupal, go to Configuration » Web services » GA4 Dashboard (/admin/config/services/ga4-dashboard), enter the two IDs, upload the key and save.
  5. Grant View the GA4 dashboard to the roles that should see the figures. Set up GA4 Dashboard is restricted: it decides where visits are sent and holds the key.

Leave the measurement ID empty to use the reports only, for example when the tag is already added by another module. The README has step-by-step instructions, including the Content Security Policy addresses Google's tag needs.

Additional Requirements

  • Drupal 11.1 or later, or Drupal 12.
  • PHP 8.3 or later with the OpenSSL extension (Drupal 12 needs PHP 8.5).
  • The private file system, for the service account key.
  • A Google Analytics 4 property and a Google Cloud service account with read access to it.
  • Dashboard, to place the dashboard block on an administration dashboard.
  • Klaro! or another consent tool, where the law asks for consent before analytics.

Similar projects

The Google Analytics module adds Google's tag with many tracking options. GA4 Dashboard's focus is the reports: it reads them from Google's Data API and shows them inside Drupal. Its own tag is optional, so you can keep tracking with the Google Analytics module and use GA4 Dashboard for the reports only.

Supporting this Module

Bug reports, feature requests and patches are welcome in the issue queue. Translations can be contributed on localize.drupal.org; an Arabic translation is included in the module's translations folder.

Ask your assistant about GA4 Dashboard

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Nov 2026
Latest release
1 hour ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.0-beta1 Pre-release 11 PHP >=8.3 Nov 2, 2026