Hi there, I’m trying to get Google Tag Manager to send a variable (Google clientId) to a hidden field in a form. Google Tag Manager is able to identify the cliendId.
Currently I’m using the following HTML code for the hidden field
< input type=“hidden” id=“hidId” name=“hidId” value=“” >
In Google Tag Manager I’m doing the following:
I’ve created a custom HTML tag:
< script type=“application/javascript”>
var hidId = document.getElementById(“#hidId”);
hidId.value={{GA - Client ID}};
< /script>
I also tried:
< script type=“application/javascript”>
var hidId = document.querySelector(“#hidId”);
hidId.value={{JS - GA Client ID}};
< /script>
I set up a delay of 5 seconds to make sure tag manager first recognizes the clientId, which it does when firing the tag.
Can anyone help me get the Google clientId in a hidden form field?
Here is my site Read-Only: https://preview.webflow.com/preview/solarsedum?utm_medium=preview_link&utm_source=designer&utm_content=solarsedum&preview=31c3395b9fdde9424265d83f73d2f633&pageId=602ed5a69340d6e2c92b63b4&mode=preview