Multilingual Data Layer configuration form showing a YAML payload with built-in tokens
Generated window.dataLayer output in the rendered page source

This project is not covered by Drupal’s security advisory policy.

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

Multilingual Data Layer configuration form showing a YAML payload with built-in tokens

Resulting page source

Generated window.dataLayer output in the rendered 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.

Project information

Releases