Custom dl and env support #7
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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