<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Receiving cookie ID from the form integrated on the back-end in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152549#M82129</link>
    <description>&lt;P&gt;To better understand your environment and your code: you've put your own form on a page that contains the tracking code, then you send the form result to your internal system, then your internal system sends the form data back to Hubspot via the Forms API?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that's what you're doing (?), here's how it works: if you put the tracking code on an internal page (external website) *and* you put a form on that page, the form submission will be automatically picked up by Hubspot, even if your internal system doesn't send it.&lt;/P&gt;</description>
    <pubDate>Wed, 14 May 2025 18:16:12 GMT</pubDate>
    <dc:creator>sylvain_tirreau</dc:creator>
    <dc:date>2025-05-14T18:16:12Z</dc:date>
    <item>
      <title>Receiving cookie ID from the form integrated on the back-end</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1151729#M82104</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know the logic here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On our website, we have multiple forms that are connected on the back-end with the HubSpot forms. So, it's never a HubSpot form integrated directly in the website.&lt;/P&gt;&lt;P&gt;When a person fills in a form, the info will first go to our central distribution system and only then will be pushed through a HubSpot form and land in HubSpot. When the info arrives in HubSpot, we know that HubSpot will receive the cookie ID too. It's important to underline, that our central system does not receive any cookie ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is: How HubSpot receieves the cookie ID in this case if the central system that pushes the info through HubSpot form integrated in the back-end, does not receive it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Mila&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 07:44:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1151729#M82104</guid>
      <dc:creator>MTarnopolska</dc:creator>
      <dc:date>2025-05-13T07:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Receiving cookie ID from the form integrated on the back-end</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1151969#M82115</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/549528"&gt;@MTarnopolska&lt;/a&gt;&lt;/SPAN&gt;, thanks for your post in the HubSpot Community!&lt;BR /&gt;&lt;BR /&gt;For reference, here is the &lt;A href="https://developers.hubspot.com/docs/reference/api/marketing/forms/v2" target="_blank"&gt;Forms endpoint&lt;/A&gt; documentation.&lt;BR /&gt;&lt;BR /&gt;Also, I'd love to put you in touch with our Top Experts: Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/101258"&gt;@Teun&lt;/a&gt;, &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt; and &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&lt;/SPAN&gt; do you have any insights to share with &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/549528"&gt;@MTarnopolska&lt;/a&gt;&lt;/SPAN&gt;, please?&lt;BR /&gt;&lt;BR /&gt;Have a beautiful day and thanks so much in advance for your valuable contributions!&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 15:27:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1151969#M82115</guid>
      <dc:creator>BérangèreL</dc:creator>
      <dc:date>2025-05-13T15:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Receiving cookie ID from the form integrated on the back-end</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1151995#M82117</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hubspot connects this to the internal mechanics of its JavaScript scripts (found on the site via the tracking code).&lt;/P&gt;&lt;P&gt;If you want to retrieve the tracking ID, you have to send it to the backend yourself.&lt;/P&gt;&lt;P&gt;You should do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function getHubSpotCookie() {
  const name = "hubspotutk=";
  const decodedCookie = decodeURIComponent(document.cookie);
  const cookies = decodedCookie.split(';');
  for (let i = 0; i &amp;lt; cookies.length; i++) {
    let c = cookies[i].trim();
    if (c.indexOf(name) === 0) {
      return c.substring(name.length, c.length);
    }
  }
  return null;
}

const hubspotutk = getHubSpotCookie();
console.log("HubSpot Cookie ID to send:", hubspotutk);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 16:13:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1151995#M82117</guid>
      <dc:creator>sylvain_tirreau</dc:creator>
      <dc:date>2025-05-13T16:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Receiving cookie ID from the form integrated on the back-end</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152218#M82123</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/549528"&gt;@MTarnopolska&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What's happening here is that HubSpot relies on the hubspotutk cookie to track visitors and associate them with form submissions. In a standard implementation where HubSpot forms are directly on your site, this happens automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case, since you're using custom forms that submit to your central system first, HubSpot doesn't have direct access to the cookie during submission. The solution is to manually capture and pass the hubspotutk cookie value along with your form data. You'll need to add some JavaScript to your forms that grabs this cookie value from the user's browser and includes it with the submission to your central system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your central system would then need to include this cookie value when it pushes the data to HubSpot's API. This is typically done by adding the "hutk" parameter in your API requests to HubSpot. So even though your central system doesn't use the cookie directly, it's just passing it through like a messenger.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using the Forms API specifically, there's a field dedicated to this purpose where you can pass the cookie value. &lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 06:50:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152218#M82123</guid>
      <dc:creator>GiantFocal</dc:creator>
      <dc:date>2025-05-14T06:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Receiving cookie ID from the form integrated on the back-end</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152265#M82125</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/577159"&gt;@GiantFocal&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your answer. The reason why I am asking this question is that I know that we don't have any additional javascript code that would help to transfer the cookie information through our central system to HubSpot. Nevertheless, I see that for new contacts that came into our CRM through the form like described previously, I do have a pageview that usually looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MTarnopolska_0-1747212647131.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/145962i77D6A2A53F5EF077/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MTarnopolska_0-1747212647131.png" alt="MTarnopolska_0-1747212647131.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is it something that is default by HubSpot ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 09:01:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152265#M82125</guid>
      <dc:creator>MTarnopolska</dc:creator>
      <dc:date>2025-05-14T09:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Receiving cookie ID from the form integrated on the back-end</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152329#M82128</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&amp;nbsp;, thank you for your answer ! It will help us in one more project &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 11:20:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152329#M82128</guid>
      <dc:creator>MTarnopolska</dc:creator>
      <dc:date>2025-05-14T11:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Receiving cookie ID from the form integrated on the back-end</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152549#M82129</link>
      <description>&lt;P&gt;To better understand your environment and your code: you've put your own form on a page that contains the tracking code, then you send the form result to your internal system, then your internal system sends the form data back to Hubspot via the Forms API?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that's what you're doing (?), here's how it works: if you put the tracking code on an internal page (external website) *and* you put a form on that page, the form submission will be automatically picked up by Hubspot, even if your internal system doesn't send it.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 18:16:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Receiving-cookie-ID-from-the-form-integrated-on-the-back-end/m-p/1152549#M82129</guid>
      <dc:creator>sylvain_tirreau</dc:creator>
      <dc:date>2025-05-14T18:16:12Z</dc:date>
    </item>
  </channel>
</rss>

