Color photo looking over the shoulder of a woman who's looking at Google Analytics on her Apple laptop
Learn more about open source platform Drupal
Drupal

Introducing the Google Tag Module for Drupal

August 28, 2023 4 minute read
Discover a streamlined integration between Google products and Drupal
Color photo looking over the shoulder of a woman who's looking at Google Analytics on her Apple laptop

Time to celebrate, Drupal users. The Google ecosystem of community Drupal modules has become increasingly vast over the years, and Acquia has simplified the landscape. Instead of the two modules previously needed to run Google Analytics (GA) and Google Tag Manager (GTM) on a Drupal website, now there’s just one. Free and optional to users, the Google Tag module offers a unified solution for all of the tech giant’s measurement ID tracking.

Those capabilities have helped marketers effectively manage websites and guide their improvements by compiling data about users and visitors — which pages they visit, how long they stay, whether they add items to their shopping carts, and so on. Marketers use this data to assess user behavior and conduct A/B tests along with a host of activities that make up today’s marketing mix, so the Google Tag module is an integral aspect of many Drupal-powered sites.

How the Google Tag module came to be

If the many articles published by the trade press didn’t alert them over the last two years, 

marketers could count on a steady drip of emails from Google about the end of Universal Analytics (UA), the company’s platform for collecting and organizing user data. Introduced in 2012 and better known as Google Analytics 3, the platform was scheduled for replacement by Google Analytics 4 (GA4) on July 1, 2023.

Knowing this, Google approached Acquia, a longtime community contributor to Drupal’s development, in 2021 to update the Google Analytics module for Drupal so that, when GA4 launched, all integrations would have full support for their product. When this work was completed, Google again approached Acquia in November 2022 to improve the Google Tag module. Google had renamed the Google Tag JavaScript framework to Google Tag and sought a Drupal module that would support both GA4 and GTM.

The idea was to consolidate the ecosystem so that, if you’re a user and you want to use Google Analytics, you don’t see five options and go, “Which one do I pick?” This was an effort to consolidate the ecosystem with the backing and direction of Google itself.

Many of Acquia’s customers use some version of Google Analytics, so our involvement was also partly motivated by a desire to constantly improve the customer  experience.

Working with Google through early 2023, Acquia officially released the improved module on April 11, 2023. Since its release, adoption of the module has increased 1,739%. The number of Drupal-powered websites that use it as of this writing total nearly 8,800. It’s a testament to our focus on test coverage and our collaboration with the greater Drupal community that we’ve only needed two minor releases after this major version. Thank you to the many community members — Jakob Perry, Matt Glaman, Alexander Sluiter, Amandeep Singh, and Ariel Barreiro among them — who have been diligent in testing, reporting, and even patching any issues they’ve seen with this new module.

Features of the Google Tag module in Drupal

What’s drawing users to the module? Besides the consolidation of the standalone GA and GTM modules into one, here’s what else to keep in mind about the Google Tag module:

  • It supports both Google Tag and GTM for Drupal 9 (D9) and above.
  • It supports out-of-the-box e-commerce features, so if you also use Drupal’s Commerce module, then the Google Tag module will track add-to-cart events, checkout-complete, and so on.
  • It supports more default events that can be monitored, such as sign_up, login, and search.
     

The new module achieved major feature parity with the former standalone GA and GTM modules, so users can rest assured that all the features they enjoyed with the previous modules can still be accessed. (Check out this tutorial on setting up the Google Tag module for D9 and above.)

What of users still on Drupal 7 (D7), though? There remain two separate modules for GA and GTM for D7. The GA standalone module supports GA4, but it’s considered deprecated for all versions except D7. (For users considering upgrading to more current versions of Drupal, here’s a handy guide.)

Go forth and conquer

With a high adoption rate, it seems users see only upsides to using the Google Tag module for D9 sites and above. No surprise — Drupal is the premier software for digital experiences. Learn why so many flock to the open source platform.

Keep Reading

View More Resources