Hi there,
We’re using the forms API on our ‘request a free trial page’ but the ‘original source’ of all our leads is always marked as ‘direct traffic’ - it seems to get lost. As far as I understood from the documentation, this info is captured in the ‘Hubspotutk’ cookie but as far as I know everything everything is passsed on:
if(isset($_COOKIE['hubspotutk'])) {
$hutk = $_COOKIE['hubspotutk'];
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n \"fields\": [\n {\n \"name\": \"email\",\n \"value\": \"XXXXX \"\n },\n {\n \"name\": \"firstname\",\n \"value\": \"XXXXX\"\n },\n {\n \"name\": \"lastname\",\n \"value\": \"XXXXX \"\n }, \n {\n \"name\": \"company\",\n \"value\": \"XXXXXX \"\n }\n ],\n \"context\": {\n \"hutk\": \"$hutk\",\n \"pageUri\": \https://app.xx.io/Signup\,\n \"pageName\": \"Application - trial page\"\n },\n \"legalConsentOptions\": {\n \"consent\": { \n \"consentToProcess\": true,\n \"text\": \"I agree to allow xx to store and process my personal data.\",\n \"communications\": [\n {\n \"value\": true,\n \"subscriptionTypeId\": 999,\n \"text\": \"I agree to receive marketing communications from xx.\"\n }\n ]\n }\n }\n}");
Are we missing anything?
Hubspot’s feedback is as follows:
"I was just in touch with one of our developers, and they can see that your PFP body request is correct within the Form API:
$hutk = $_COOKIE['hubspotutk'];
This leads them to conclude that there might be an error in the way you are handling the process of capturing the hutk value, which is required in order to pass on the information within the above mentioned line of code to submit the cookie information." but we’re kind of stuck at this point. Thank you in advance!