Environment ID max length should be extended

Created on 4 September 2025, about 1 month ago

Problem/Motivation

Current implementation of the **Environment ID** configuration field in the module restricts input length to a maximum of 7 characters.
Google Tag Manager (GTM) environment IDs (e.g., `env-1234`) can exceed this limit. GTM documentation and API do not specify a maximum length, and the ID is treated as an arbitrary string.
This restriction prevents valid GTM environment IDs from being entered, making the module incompatible with certain GTM setups.

Steps to reproduce

1. Install and enable the `google_tag` module.
2. Go to the module configuration page.
3. Attempt to save an environment ID such as `env-1234` (8 characters).
4. Observe that the form validation prevents saving due to the max length constraint.

Proposed resolution

- Increase the `#maxlength` of the Environment ID field from 7 to a more reasonable value (e.g., 10, the same as the size attribute of the field).

Remaining tasks

- [ ] Create a patch/merge request adjusting the form element definition.
- [ ] Review and merge the PR.

User interface changes

- No visual UI changes.
- The Environment ID field will now accept longer input values.

Data model changes

- None.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇱Netherlands aposudevsky Eindhoven

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024