I have spent so many hours just trying to figure out why Velo cannot recognize my form field key/field title to assign a utm parameter to the field… and no I am not misspelling the field key or getting it wrong.
import wixLocationFrontend from 'wix-location-frontend';
$w.onReady(function() {
const query = wixLocationFrontend.query;
let utmSource = decodeURIComponent(query.utm_source);
// // Use direct element ID references to set values
if (query.utm_source) {
$w('#djform').setFieldValues({
utmsource_1: 'test',
});
}
// Debugging: Check that the values are set
console.log("Source:", $w('#utm_source').value);
});
For some reason Velo can’t recognize utm_source1 when I’m trying to set that hidden field value to a specified utm parameter, right I’m just using ‘test’ as a dummy.