I am trying to create and populate a hidden field on the form using google tag manager and JS.
It worked fine on one group of forms

However, it doesn't work on this one.

What do I need to modify to insert the hidden field on 2 nd form (besides the obvious "append to the element" part? Thank you!
Here is the script:
var input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("name", "GAIDinserttest");
input.setAttribute("value", "{{extract GAID-GA Client ID}}");
//append to form element .
document.getElementById("gform_page_2_1").appendChild(input);
</script>