Thanks. The custom gclid_C field was created and mapped in Salesforce and we created a new Brilliant form with the custom field set as “enabled” and the type value set to “hidden.” We added shortcode and the script to the page and the form does not appear to submit and does not post to salesforce.
Separately, we have successfully been able to post the gclic id using native salesforce web-to-lead functionality based on the following script (posted below) but this means that we cannot leverage the Brilliant plugin capabilities. Appreciate any thoughts you can provide.
<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST"><script>
window.onload = function getGclid() {
document.getElementById("XXXXXXXXXXXXXXX").value = (name = new
RegExp('(?:^|;\\s*)gclid=([^;]*)').exec(document.cookie)) ?
name.split(",")[1] : "";}
</script>
<input name="oid" type="hidden" value="XXXXXXXXXXXXXXX" />
<input name="retURL" type="hidden" value="https://" />
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" />
<input id="XXXXXXXXXXXXXXX" name="XXXXXXXXXXXXXXX" type="hidden" />
<input name="submit" type="submit" />
</form><script type="text/javascript">
function setCookie(name, value, days){
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
var expires = "; expires=" + date.toGMTString();
document.cookie = name + "=" + value + expires;
}
function getParam(p){
var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
var gclid = getParam('gclid');
if(gclid){
var gclsrc = getParam('gclsrc');
if(!gclsrc || gclsrc.indexOf('aw') !== -1){
setCookie('sf_gclid__c', gclid, 90);
}
}
</script>