Hubspot API forms - The cookie needed to link form submissions

I always see this whenever i submit a form data

Im using a custom form where i submit all the data using the hubspot api(legacy version).

This is my php code for using api to send form data to hubspot. Is there a way to fix that notice regarding to cookie using hubspot API?

Hi @ablayze_jb ,

Your $hs_context is missing the ‘hutk’ value. It should look like this:

$hubspotutk = isset($_COOKIE['hubspotutk']) ? $_COOKIE['hubspotutk'] : ''; // This is the missing cookie

$hs_context = array(
 'hutk' => $hubspotutk,
 'ipAddress' => $ip_address,
 'pageUrl' => $page_url,
 'pageName' => $page_name
);

Thanks. This is working

Can this be wrapped in a function for Wordpress? I am using the Gravity Forms HS integration and this cookie seems to be missing when sending form submissions.

I wanted to do this in js. How could I do this? I am using fetch to send POST API request.

Hi!

I have the same problem, but using Gravity Forms in Wordpress.
Do you have any idea why it would be?

Thanks in advance!