Active
Project:
Google Tag
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2025 at 13:54 UTC
Updated:
13 Mar 2026 at 12:35 UTC
Jump to comment: Most recent
In 8.x-1.x version of the google_tag module we have below service
\Drupal::service('google_tag.container_manager')->getScriptAttachments($variables);
do we have similar things in 2.x release of this module
Comments
Comment #2
nitesh624Comment #3
nitesh624Hi Can anyone help here. I got this from https://www.drupal.org/project/drupal/issues/3042383#comment-14205901
Comment #4
nitesh624So my requirement is as below:
I have a media type named
youtube_videoand this media has a plain text field to capture youtube url and from manage display config i have configured this field to show asoEmbed contentNow this youtube url is rendered as an iframe and I want to inject the GTM script within this iframe
So when i doing research, I came across https://www.drupal.org/project/drupal/issues/3042383 issue and from https://www.drupal.org/project/drupal/issues/3042383#comment-14205901 i got below code snippet which is using
\Drupal::service('google_tag.container_manager')service . but this service is no longer exists on 2.x version of google_tag module.Is there any way to achieve my requirement with 2.x version of google tag module?
Comment #5
nitesh624Can anyone from the module maintainers help here?
Comment #6
nitesh624hi is there any update here