Capture UTMs using Formstack forms (V4)
This form is only workscompatible inwith HandL UTM Grabber V3V3.
AddPlease add the hidden fields as follows.outlined Makebelow. sureEnsure that the hidden field name (either the field label or placeholderplaceholder) exactly matches with our naming convention heredetailed here: Native WP Shortcodes).
AfterAs of version 3.0.59, you do not need to perform any additional steps, as Formstack V4 is natively supported.
If you are using HandL UTM Grabber 3.0.58 and below. Then proceed with the following step:
Upon activating the UTM Grabber V3 plugin, insert the following code ininto your custom javascriptJavaScript file:
function FF_OnAfterRender()handl_utm_all_params.map(function(v){
console.log("Formvar renderedform successfully!"= jQuery('.fsForm');
var varscurVal = ["Lead.UTM_Campaign__c","Lead.UTM_Medium__c","Lead.UTM_Source__c","Lead.UTM_Term__c","Lead.UTM_Content__c","Lead.GCLID__c","Lead.FBclid__c"]
for (v of vars){
escape_v = v.replace(/\./g, '\\.')
jQuery("#"+escape_v).val(Cookies.get(v);
form.find("[placeholder='"+v+"']").val(curVal);
}
return true;
})
AndThis code will automatically populate the fields willafter be automatically populated aftera lead is submitted.