I used this script before the closing </body> tag in the page HTML:
<script type="text/javascript">
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
var cmp = getUrlVars()["cmp"];
if (cmp != null) {
$("input#MKTOCampaign").val(cmp);
}
</script>
The name of the field I wanted to pull a value into was MKTOCampaign and the name of our parameter was cmp, so you would want to replace that text with your field ID and URL parameter. I hard-coded the default value into the #MKTOCampaign field on the form HTML that I exported like so:
<input class='mktFormHidden' name="MKTOCampaign" id="MKTOCampaign" type='hidden' value="701E0000000ADt2" />
The script above runs when the page is loaded, and checks to see if there is a cmp parameter in the URL. If there is, it updates the MKTOCampaign field with the new campaign ID from the URL. If there isn't, it keeps the default value that I had initially hard-coded. It worked pretty well!