This module allows you to easily send language-specific tracking data to Google Tag Manager. You can define custom key-value pairs for each language using simple YAML configuration, and the module will automatically inject this data into the `window.dataLayer` object. This helps ensure that your analytics tools receive the correct information for every language version of your Drupal site.
Multilingual Data Layer makes it easy to send the right tracking information to Google Tag Manager for every language on a Drupal site. Add simple YAML for each language and the module places the matching data in window.dataLayer.
Features
- Provides one YAML field for each enabled Drupal language.
- Lets site builders choose their own keys and values.
- Supports nested objects, lists, strings, numbers, booleans, and null values.
- Includes tokens for the current URL, path, language ID, and language name.
- Adds the data layer script to the document head.
- Produces no script when the current language field is empty.
- Provides an alter hook for developers who need additional logic.
The module supplies data only. It does not install Google Tag Manager, add a container snippet, or send analytics events.
Post-installation
Go to Configuration > Regional and language > Multilingual Data Layer. Enter YAML for each language that needs a payload. The configuration page includes a reference for all available tokens. Save the form and inspect window.dataLayer in the browser.
Screenshots
Language-specific configuration
Resulting page source
Additional requirements
Requires the Drupal core Language module. No external service or JavaScript library is required.
Similar projects
The Data Layer project exposes entity, field, taxonomy, user, and page metadata. The GTM dataLayer project provides broader Google Tag Manager integration. Multilingual Data Layer focuses on administrator-authored payloads that can differ by Drupal language.
Supporting this module
Use the project issue queue to report bugs, request features, or contribute improvements.
Community documentation
Installation, configuration, extension, and privacy guidance is included in the project README.
Ask your assistant about Multilingual Data Layer
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- language Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.0 | Stable | 10–11 | Sep 10, 2026 | ||
| 1.0.0-beta2 | Pre-release | 10–11 | Sep 10, 2026 | ||
| 1.0.0-beta1 | Pre-release | 10–11 | Sep 10, 2026 |