Google Analytics for Drupal configuration page

Users must upgrade to Google Analytics 4.0.2 (Drupal 9.3+), 4.0.1 (Drupal 8+), or 7.x-2.8+ before the legacy GA service shuts down July 1st 2023. Google suggests users install the new 2.x version of Google Tag for future Google Analytics support.

Adds the Google Analytics web statistics tracking system to your website.

The module allows you to add the following statistics features to your site:

  • Single/multi/cross domain tracking
  • Selectively track/exclude certain users, roles and pages
  • Monitor what type of links are tracked (downloads, outgoing and mailto)
  • Monitor what files are downloaded from your pages
  • Custom dimensions and metrics support with tokens
  • Custom code snippets
  • Site Search support
  • AdSense support
  • Demographics and Interests support (formerly known as DoubleClick remarketing support)
  • Anonymize visitors IP address
  • DoNotTrack support (non-cached content only)
  • Drupal messages tracking
  • Modal dialog tracking (Colorbox)
  • Access denied (403) and Page not found (404) tracking
  • Cache the Google Analytics code on your local server for improved page loading times
  • Enhanced Link Attribution support
  • User ID tracking across devices
  • Changing URL fragments can be tracked as pageviews
  • Debug mode with analytics_debug.js

Version specific features

  • Legacy Universal Analytics (UA) support: 6.x-4.x, 7.x-2.x, 8.x-2.x
  • Legacy Global Site Tag (gtag.js) support: 8.x-3.x
  • Global Site Tag Version 4 support: 4.x

Current Supported version:4.x and 7.x-2.x

The 4.x module supports multiple accounts, which will allow you to run multiple tags within the same module. The 7.x-2.x version supports the latest GA (gtag) 4 service from google.

Users are strongly encouraged to use Google Tag 2.0+ instead. It supports all of GA4 and is the successor to this module.

Other related modules

  • Google Analytics Reports provides graphical reporting of your site's tracking data. Graphical reports include a dashboard widget for admins, a small path-based report in blocks, and a full path-based report.
Supporting organizations: 
gtag 4 Development
Gtag 4 Development

Project information

Releases