title: Pardot Server Side Form Handler: Extract the cookie ID from the browser and pass it to the visitor_id
body: <p>I'm currently working on a system to post existing forms to a Pardot Form Handler via a server side process. I've got the form posting to Pardot via WordPress' helper function <a href="https://codex.wordpress.org/Function_Reference/wp_remote_post" rel="nofollow noreferrer">wp_remote_post</a> using the following code. (Its a CURL post at its core):</p>
  
  <pre><code>$response = wp_remote_post( 'https://ourdomain.com/l/82632/2018-04-26/544m2kc' , array(
          'timeout'   =&gt; 45,
          'body'      =&gt;  $form_data
       )
  );
  </code></pre>
  
  <p>However Pardot Requires a tracking cookie to be sent with the data. On site <a href="http://nebulaconsulting.co.uk/using-pardot-form-handlers/" rel="nofollow noreferrer">http://nebulaconsulting.co.uk/using-pardot-form-handlers/</a> there is the following quote:</p>
  
  <blockquote>
    <p>A server-side post can also pass the Pardot browser cookie through
    with the data so future web activity can be tracked. This requires an
    extra script to extract the cookie ID from the browser and pass it to
    the visitor_id field in Pardot.</p>
  </blockquote>
  
  <p>Does anyone have any help on how I can do this?</p>