Hi Jeffrey Yee,
Thanks for your ee12 session on query strings. We are following the instruction on page 37 and 38 to capture the query string information into Eloqua. I'm not sure if you can help, but here is what we've done.
Created custom field called 'Lead Source Query' database name: C_Lead_Source_Query1
Added hidden filed on form and updated processing step to include this new field through 'Update contacts - With Form Data'
the Form name is: cORP201212SUSTERMVERDANTIXWEBWEBCASTLIVE-135468647
the query string parameter is: utm_medium
name of the field is: Lead_Source_Query1
Added the following code to the landing page under Tools>Page Snippet Tools>JS. What am I doing wrong? Thanks...
<script type="text/javascript">var defaultHiddenFieldNameValue = "";
function getQueryStringParamValue(strQStrParam) {
var strURL = document.location.href;
var strQStrParamValue = "";
if (strURL.indexOf('?') != -1)
{
strQStrParamValue = strURL.substr(strURL.indexOf('?') + 1);
if (strQStrParamValue.indexOf(strQStrParam) != -1)
{
strQStrParamValue = strQStrParamValue.substr(strQStrParamValue.indexOf(strQStrParam));
strQStrParamValue = strQStrParamValue.substr(strQStrParamValue.indexOf('=') + 1);
if (strQStrParamValue.indexOf('&') != -1)
strQStrParamValue = strQStrParamValue.substr(0, strQStrParamValue.indexOf('&'));
return strQStrParamValue;
}else{
strQStrParamValue = defaultHiddenFieldNameValue;
return strQStrParamValue;
}
}else{
strQStrParamValue = defaultHiddenFieldNameValue;
return strQStrParamValue;
}
}
// Form name goes here
var form = "cORP201212SUSTERMVERDANTIXWEBWEBCASTLIVE-135468647";
function setCampaign(){
var elqForm = document.forms[form];
//repeat for each field to populate
elqForm.elements['Lead_Source_Query1'].value = getQueryStringParamValue('utm_medium');
}
window.onload = setCampaign; </script>
Thanks,
Cristian