The patches for this stopped working for us after a recent module update. Inspecting the most recent patch version (under issue fork - plain diff), I can see that most of the changes are now in the module.
Actually I'm not quite right with my description of how it's behaving now, but it's still not correct. If someone could see if they can replicate that would be awesome.
@smustgrave unfortunately this doesn't seem to resolve things. After implementing the change suggested by @shiv_yadav the visibility on "select3" is now only linked to "select1". So I beleive there is still a valid issue here.
I realised I needed to do something similar to the noscript output of this module.
I 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.
I 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.
Ashley George → created an issue.