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 wp_remote_post using the following code. (Its a CURL post at its core):
$response = wp_remote_post( 'https://ourdomain.com/l/82632/2018-04-26/544m2kc' , array(
'timeout' => 45,
'body' => $form_data
)
);
However Pardot Requires a tracking cookie to be sent with the data. On site http://nebulaconsulting.co.uk/using-pardot-form-handlers/ there is the following quote:
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.
Does anyone have any help on how I can do this?
Zachary's answer is great but I'd like to point out that the visitor_id key doesn't match up exactly with the piAId (Account Id): it's the Account ID minus 1000.
Not sure why Pardot do this but I've confirmed it with multiple instances.
So if your piAid is 315092, your visitor_id key will be: visitor_id314092
Therefore, in Zachary's example, it will be: 'visitor_id' => 'Value of visitor_id314092 cookie'
Edit: this seems to have been resolved by Pardot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With