I have a code that runs via GTM that sets a parameter that I can access via calling (i.e sessionId). I would like to have this parameter value injected into a hidden field so I could grab it along with the rest of the form data. I am able to do this via the console when viewing my site however the actual form field value is not being sent. Is this even possible?
How would I inject URL parameters into hidden fields for the same functionality as the first question?
If you’re using the Wix Form app it may be possible (depends on the form).
If you built your own custom form from scratch the it’s definitely possible (but you can also submit the data without assigning it to an input element).
Any way, if you go for the hidden field, make the input elem hidden and:
import wixLocation from "wix-loaction";
const query = wixLocation.query;
const id = query.id;
//retrieve the GTM
$w.onReady(() => {
$w("#input7").value = gtm;
$w("#input8").value = id;
})