Fixed
Project:
Google Tag
Version:
2.0.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2024 at 22:01 UTC
Updated:
16 Nov 2026 at 22:15 UTC
Jump to comment: Most recent
I recently updated a project from Drupal 8.9 to Drupal 10. The old versions used the old version of Google Tag Manager module and the new one uses now Google Tag 2.0.2. I enabled the option to create multiple containers than I add a new container but there no option to edit label or machine name. They are assigned automatically.
Image attached to see the current status.
Add fields to be able to edit the label and machine name (by creating a new container)
| Comment | File | Size | Author |
|---|---|---|---|
| Bildschirmfoto 2024-02-11 um 22.32.54.png | 62.71 KB | juagarc4 |
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
japerryThis is by design. The machine name and label are auto-generated because requiring users to create them is an additional unneeded step. Is there a reason why they needed to be edited specifically?
Note -- if there is a need to change them, it can be done manually with the config entity. Since they really shouldn't be changed by end users, I'd suggest going this route instead of changing the UI.
Comment #3
japerryComment #4
juagarc4 commentedHi japerry,
Thanks for the answer.
Since you can use more containers and more IDs per container, I think it make sense, so that the label and machine name can be used as a kind of categories.
One use case I have for that right now is the use of this module in combination with Domain. Since I'm using different containers per Domain, it would be useful to put the domain name in the label. In this way is easier to identify what need to be changed, deleted, etc. without having to edit all of them.
Moreover the use of a customized machine name in the same way of the label would make easier to get information of the container programatically.
Note: Changing the config entity can be easy done by programmers, but normally the users authorized to change this configuration, don't have the knowledge for that. In this case a change in the UI would be quite appreciated.
Comment #5
guiu.rocafort.ferrerIMO, it would be useful to be able to change the Label, but the machine_name should not be possible to be changed. This allows to add more meaningful names to the containers, rather than having to remember the container ids. This behaviour is widely used in Drupal Core, for instance, if you create a content type, then you can modify the label, but the machine_name stays the same.
There is already a label field in the entity type google_tag_container. So this would only require to add the textfield element in the edit form.
I will create a issue fork and give it a go, should be fairy easy to do.
Comment #6
guiu.rocafort.ferrerI added the label field to the edit form, but i am taking in account the following cases, to avoid disrupting existing workflows and add extra steps when creating a tag container:
The machine_name is still generated in the same way, and it cannot be changed.
I think this would be a great usability improvement for the module, because it allows to add friendly readable names to containers. If you have several containers, it can become complicated to know which is which.
Comment #7
juagarc4 commentedI'm agree with this approach @guiu. The possibility of changing of the machine name is really not necessary.
I'll try to test it in the next days.
Thanks!
Comment #8
guiu.rocafort.ferrerChanging issue status to needs review.
Comment #10
japerryAgreed on the label. The machine name stays as it is: other config refers to it, and core config entities don't allow renaming one either. That part is won't fix.