Create all hubspot cookie


#1

Hello Everyone,

When we submit any hubspot form generated by hubspot script that usually creates hubspot cookie like HUBSPOTUTK and few more.

I want to create all those cookies after submit the form using APIs.

Here is the full scenario
We have few form which is created by using hubspot form embed script. and few forms which we are submitting using APIs.

Now if any user submit form which is generated by the embed script few cookies dropped by hubspot which helps to re-submit the data again. But if I am trying to submit the form using APIs then it won't create any cookie. Hence i can't use those details trough out the site . I mean i have to ask again for those details if they want to submit again.

So if i can get hubspotutk key after submit the form using API then we can use that information again.

Thank you in advance.


#2

Hi @ashishkumar,

The hubspotutk cookie is created when a visitor first visits a page with the HubSpot tracking code on it (the same is true for the other cookies). A form submission doesn't create these cookies, but rather associates them with the contact record created as a result of the form submissions. It's not currently possible to manually create these cookies; you'll need to have the HubSpot tracking code on your site pages in order for this cookie to be created.

It is possible to manually associate an existing hubspotutk cookie with a contact using the Tracking Code API, however. Check out the following docs for some more info there: