Skip to content

Instantly share code, notes, and snippets.

@courtnEMAIL
courtnEMAIL / mkto1.js
Created July 13, 2020 20:26 — forked from entendu/mkto1.js
Set Marketo fields
MktoForms2.loadForm("//app-sjXX.marketo.com", "XXX-XXX-XXX", formID, function(form) {
var myUTM = your_utm_function(); // This function is your custom logic to retrieve the user's UTM codes.
form.setValues({
"utm_source": myUTM.source;
"utm_campaign": // etc etc
});
});
@courtnEMAIL
courtnEMAIL / mkto2.js
Created July 13, 2020 20:25 — forked from entendu/mkto2.js
Dyamically setting Marketo form field values
MktoForms2.loadForm("//app-XXXX.marketo.com", "XXX-XXX-XXX", formID, function(form) {
form.setValues({
// Update this with the field/value.
"my_field": "my value!"
}, function(k, v){var o={};o[k]=v;form.addHiddenFields(o)});
});