GoogleTagManager settings form

This Google Tag Manager project allows non-technical stakeholders to manage the analytics for their website by triggering the insertion of tags and tracking systems onto their page(s) via Google's Tag Manager (GTM) hosted application.

To use the module, sign up for GTM and obtain a "container ID" for your website. Enter the "container ID" on the settings form for this module. You may also configure the conditions on which the tags are inserted on a page response. Conditions exist for: page paths, user roles, and response statuses.

The module implements the Variable API, so that settings may be separately configured by realm, thus enabling support for multiple languages and domains. For development purposes, create a GTM environment for your website and enter the "environment ID" on the settings form for this module.

NOTES:

  • Prefer the 1.2-rc3 release over the 1.1 release as it fixes some bugs in the 1.1 release and adds several features. It is not shown below due to 'stable' releases being preferred over 'unstable' releases. Or simply use the development release.
  • After update to 7.x-1.1 (not recommended), visit the module settings page, confirm your settings, and click save to update the settings.
  • If your site is not using PHP 5.4+, then please use the first commit after the 7.x-1.1 release (as the 1.1 release has a couple of instances of 5.4 syntax).

Related projects
Other projects that rely on or can be used with this project include:

Drupal 6 release
If interested in GTM with Drupal 6, see the port offered at #2830356: Drupal 6 port. This port is based on the 1.0 release, is generously provided by the person who posted it, has not been reviewed by the maintainer of this module, and is not a supported release. Use at your own discretion.

Project Information

Downloads