Hey folks! I’m having an issue with capturing the
hubspotutk cookie and sending it to HubSpot via API.
I have a sign-up form in a Laravel + Blade app hosted at
dns.lumiun.com, and the HubSpot tracking script is being loaded via Google Tag Manager using a custom HTML tag:
In GTM, the trigger is set to fire on pages where the hostname
contains “lumiun.com”, so it should include
dns.lumiun.com.
In the form, I try to capture the hubspotutk cookie using JavaScript and set it into a hidden input before submitting.
I even added a 2-second delay on the form’s submit event to give the cookie time to load before sending the data.
Still, when the form is submitted and data is sent using the
HubSpot Forms API (
https://api.hsforms.com/submissions/v3/integration/secure/submit/...),
most of the submissions come with a null hutk, and they show up in HubSpot as direct traffic.
I’ve logged the values before sending, double-checked GTM and script timing — everything seems to be working, except I’m not getting that cookie. I’ve seen some people mention browser tracking prevention might block the cookie, but the percentage is way too high for that to be the only reason.
Has anyone run into this before? Any tips to make sure the hubspotutk gets captured and properly sent with the API submission? Thanks a lot!