Problem/Motivation
The module dows not provide the ability to include a GTM environment query parameters to the GTM script URL
Proposed resolution
Add ability to include GTM Environment ID and Token in configuration and include in the rendered snippets.
Comments
Comment #2
matteo.borgognoni commentedComment #3
matteo.borgognoni commentedComment #4
batigolixI found some issues with the patch:
This is missing a documentation block.
Also , as it is a helper function, I think it is a convention to rename it to _cookiebot_gtm_prepare_query()
Concatenating a function with some strings looks weird. I'd do something like:
But maybe there is a more elegant solution for this.
Comment #5
batigolixComment #6
batigolixComment #7
ashley george commentedI was finding that the with Matteo's patch the ampersands in the GTM script were being rendered as encoded (&).
I notice that when the html_tag was being rendered, it was being run through a sanitising function before setting that new value as the eventual markup.
In our module, if you set the #value of the html_tag as markup then it bypasses the sanitisation.
I'm not sure if this is the right thing to do but it allowed us to move forward.
Comment #8
ashley george commentedI realise I accidentally included a change from a seperate patch which altered the script to use 'defer' rather that 'async'. Here's an update without that.
Comment #9
ashley george commentedI realised I needed to do something similar to the noscript output of this module.
Comment #11
roaldnel commentedI have tested the latest patch and I also applied changes as suggested by batigolix. The code was released in version 1.0.14.