Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Google Tag

105,578 sites Security covered Drupal 9–11
View on drupal.org

This module integrates your site with Google Tag Manager, allowing you to deploy analytics and measurement tags through a web interface without directly editing your website's code. It supports multiple containers and allows you to specify conditions for inserting tags, such as by path, user role, or domain.

Google Tag

The 2.0.x branch supports Google Tag and Google Tag Manager. Users of Google Analytics should be using the 2.x version of this module.

This project integrates the site with the Google Tag Manager (GTM) application. GTM allows you to deploy analytics and measurement tag configurations from a web-based user interface (hosted by Google) instead of requiring administrative access to your website.

To use the module, sign up for GTM and obtain a "container ID" for your website. For development purposes, create a GTM environment for your website.

CRITICAL NOTES for releases 8.x-1.3+
If the site enables other modules that implement condition plugins (e.g. ctools, rules, webform), then it will most likely be necessary to apply the core patch from issue '3114467' (link intentionally omitted).

If Drush commands are run as a user other than the web user, then do NOT enable the recreate snippets on cache rebuild module setting unless the web user has permission to delete files created by the Drush user. This setting will be disabled by default beginning with release 8.x-1.6.

Features in 8.x and 7.x-2.x branches
These branches support multiple containers. From the container management page, add a container and enter the "container ID" and "environment ID" on the container form. You may also configure the conditions on which the tags are inserted on a page response. Conditions exist for: request path, user role, response status, domain, and language. The latter two require the domain and language (8.x) or locale (7.x) modules, respectively.

In addition, other modules may also define and implement additional conditions using the condition plugin architecture in 8.x or the exposed hooks in 7.x (see the api.php file). Alternatively, other modules can implement hook_google_tag_insert_alter() to apply additional conditions on the containers inserted on a page response.

Additional features in 7.x-2.x branch
The 7.x-2.x branch also provides a variable realm condition. The realm condition may be used to filter the containers by realm, such as language and domain. This feature requires the variable_realm and variable_store modules to be enabled and configured.

Features in 7.x-1.x branch
This branch implements the Variable API, so that settings may be separately configured by realm, thus enabling support for multiple languages and domains.

False positives from Google Search Console
If you attempt to verify your site for GTM using the Google Search Console, be aware the Google tool will return false positive results. For example, the tool will indicate the "noscript" snippet needs to be placed "immediately" after the opening body tag. (NOTE: The module places the snippet as close to the body tag as can be done using standard Drupal hooks.) Verification using this tool may fail but the JavaScript works properly and tags will be added to the page and fired as defined in your GTM account. If you want this snippet immediately after body tag, then modify the theme template file (html.tpl.php for Drupal 7, html.html.twig for Drupal 8), as it controls how close the snippet will be to the body tag.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

1 tracked project depends on this one

Activity

Tracked releases
5
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 5
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
2.0.9 Stable 9–11 Aug 25, 2025
2.0.8 Stable 9–11 Jan 29, 2025
8.x-1.8 Stable 8–10 Jan 28, 2025
7.x-2.3 Stable Jan 28, 2025
2.0.7 Stable 9–11 Dec 2, 2024