How to Set Hidden Form Field Values Permanently via Form Alter
Ok webforms are a bit tricky ... but this will work i don't really care to set hidden fields just set the data direct to the entity.  

if this is not a multy step form you could probably ad another submit handler in your form alter aka ...

function MODULE_form_alter(&amp;$form,\Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
   if ($form_id === FORM_ID) { 
     $submit[] = 'MODULE_form_alter_submit';
  }
}
// then 
function MODULE_form_alter_submit(&amp;$form,\Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
     // get the data you need.. via this ..
    $previousUrl = \Drupal::request()-&gt;server-&gt;get('HTTP_REFERER');
    $prog = getLeadProgramContact($previousUrl); 
    // or ($_GET) or session or cookie whatever you chose.. Then set    it 

    // GET the form Object.
    $webform_submission_object = $form_state-&gt;getFormObject();
    // GET the submission object.
    $webform_submission = $webform_submission_object-&gt;getEntity();
    // Optioanl default values if need to play with them .. 
    $orig_data = $webform_submission-&gt;getOriginalData();
    // set form state
    $form_state-&gt;setValue('referrer', $prog-&gt;...);
    // set submission field value.  
    $webform_submission-&gt;setElementData('referrer', $value);

    $form_state-&gt;setValue('program_name', $prog-&gt;...);
    $webform_submission-&gt;setElementData('program_name', $value);
    // Save it so it cant go away.
    $webform_submission-&gt;save();

  }
 }
}