Drupal CMS Google Analytics
Description
The Drupal CMS Google Analytics recipe integrates Google Analytics and Google Tag Manager tracking into your Drupal site. It works with the privacy module to ensure that tracking respects visitor consent preferences.
Recipe Dependencies
Depends on the following recipes:
Basic privacy features for consent management, ensuring tracking scripts load only with visitor consent.
Included Modules
Brings in the following core and contributed modules to your site:
Sets up Google Tag.
Configuration Input
This recipe accepts the following configuration input during installation:
property_id: Your Google Tag Manager property ID. Supported formats:
GT-xxxxxx: Google TagG-xxxxxxxx: Google Analytics 4 measurement IDAW-xxxxxxxxx: Google Ads conversion IDGTM-xxxxxxxx: Google Tag Manager container IDDC-xxxxxxxx: Floodlight (Campaign Manager) tag
Installation
Apply the recipe using Drush:
Usage
After installation, configure your Google Tag Manager property ID through the site configuration. The tracking code is automatically injected into all pages, but only activates after visitors provide consent through the Klaro consent manager (installed by the privacy dependency). This ensures compliance with privacy regulations such as GDPR.
Last updated