Hello,
I am having trouble with saving the google cliend id (cid) into a hidden field. I am able to get the cid, get it written out in an alert, in a var and as a string, but the last step to save it is taunting me...
Is there someone here who have done this and can tell me where I am messing it up? (I have double checked that the form field name is correctly written)
Please, I already shaves my head but I'm going bold here!!
<script>MktoForms2.loadForm("//app-lon02.marketo.com", "***-***-***", ****, function(form) {
function getgacid() {
try {
var tracker = ga.getAll()[0];
return tracker.get('clientId');
} catch (e) {
return 'n/a';
}
}
var gacid = getgacid();
var cid = gacid.toString();
form.vals({"SE_OS_40":"cid", 'SE_OS_50':cid});
alert("Funkar! cid= " + getgacid() + "& " + gacid + " & cid :" + cid);
});
</script>
Solved! Go to Solution.
form.addHiddenFields(), not form.vals/setValues.
this would be Sanford Whiteman 2 (FigureOne) who can help.