Skip to content

Conversation

@floriangoetting
Copy link

@floriangoetting floriangoetting commented Mar 21, 2025

Hi Simo,
I really appreciate your GTM Loader Template but we had to adjust it to match our needs and I though it would be a great idea to create a pull request so others can benefit from our adjustments as well :)

I added the option to override the data layer name, so in the same way as the Container ID does not need to be part of the request URL, the Data Layer Name with the query parameter "l" does not need to be part of the request params but can be set in the client settings.

Additionally I added support for the GTM Environments. So far the gtm_preview and gtm_auth parameters were only forwarded if the gtm_debug parameter was present. Now I updated the code to make sure that all gtm params for the environments are forwarded to googletagmanager.com and that this is handled as preview request as well. This adds support for own gtm environments where the request contains the gtm_auth, gtm_preview and gtm_cookies_win parameters but no gtm_debug parameter.

I hope you find this valuable and I would be very happy if this will be merged in the official repository :)

Best regards
Florian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant