Hey guys,
Sorry for the very delayed response here. I worked with a developer to get this javascript code working on our page. If I remember correctly, it takes the URL and separates out the query string values. Then the second set of javascript adds the hidden fields and fills it with the query string.
<script type="text/javascript">
function getUrlVars() {
var map = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
map[key] = value;
});
return map;
}
</script>
This should be placed after the form has been called since it uses the whenReady function of the API.
<script>
var hiddenFields = getUrlVars();
MktoForms2.whenReady(function(form){
form.addHiddenFields({"MARKETO-FIELD-NAME":hiddenFields.QUERY-STRING-NAME || "DEFAULT-VALUE"});
});
</script>
Hope this helps!
Billy