function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } var hidden_field_id_1 = 'cp_hidden_input-2-19872'; var get_hidden_value_1 = getUrlVars()["utm_source"]; jQuery( "#" + hidden_field_id_1 + " .cp-target").attr('value',get_hidden_value_1 ); var hidden_field_id_2 = 'cp_hidden_input-3-19872'; var get_hidden_value_2 = getUrlVars()["utm_campaign"]; jQuery( "#" + hidden_field_id_2 + " .cp-target").attr('value',get_hidden_value_2 ); var hidden_field_id_3 = 'cp_hidden_input-4-19872'; var get_hidden_value_3 = getUrlVars()["utm_medium"]; jQuery( "#" + hidden_field_id_3 + " .cp-target").attr('value',get_hidden_value_3 );