<?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: Collecting Session URL in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Collecting-Session-URL/m-p/1146181#M42977</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't find the exact post, but I basically&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put this code in my browser:&lt;BR /&gt;first to create the cookie:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;script&amp;gt;
  function getCookie(name) {
    var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
    return match ? decodeURIComponent(match[2]) : null;
  }

  var aid = getCookie('aid');

  if (aid &amp;amp;&amp;amp; window._hsq) {
    console.log('%c[HubSpot AID] Success:', 'color: green; font-weight: bold;', 'Found aid =', aid, '| Sending to HubSpot via _hsq');
    window._hsq.push(['identify', {
      aid: aid
    }]);
  } else if (!aid) {
    console.warn('%c[HubSpot AID] Warning:', 'color: orange; font-weight: bold;', 'No aid value found in cookie.');
  } else if (!window._hsq) {
    console.error('%c[HubSpot AID] Error:', 'color: red; font-weight: bold;', 'HubSpot tracking object (_hsq) not found.');
  }
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then to get the cookie and send it to hsq:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;script&amp;gt;
  function getCookie(name) {
    var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
    return match ? decodeURIComponent(match[2]) : null;
  }

  var aid = getCookie('aid');
  var maxAttempts = 10;
  var attempts = 0;

  var interval = setInterval(function () {
    if (typeof window._hsq !== 'undefined') {
      if (aid) {
        console.log('%c[HubSpot AID] Success:', 'color: green; font-weight: bold;', 'Found aid =', aid, '| Sending to HubSpot via _hsq');
        window._hsq.push(['identify', { aid: aid }]);
      } else {
        console.warn('%c[HubSpot AID] Warning:', 'color: orange; font-weight: bold;', 'No aid value found in cookie.');
      }
      clearInterval(interval);
    } else {
      attempts++;
      if (attempts &amp;gt;= maxAttempts) {
        console.error('%c[HubSpot AID] Error:', 'color: red; font-weight: bold;', 'HubSpot tracking object (_hsq) not found after 10 attempts.');
        clearInterval(interval);
      }
    }
  }, 500); // Check every 500ms
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;And assumed once the contact is created hubspot will be able to link that aid value to the customer contact field i created thats called aid too.&lt;/P&gt;</description>
    <pubDate>Thu, 08 May 2025 18:34:51 GMT</pubDate>
    <dc:creator>omaklad</dc:creator>
    <dc:date>2025-05-08T18:34:51Z</dc:date>
    <item>
      <title>Collecting Session URL</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Collecting-Session-URL/m-p/1145971#M42968</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a chatbot created using chatflows on my website, I need to be able to capture a specific parameter from the session URL and save it to the contact record created by the bot.&lt;/P&gt;&lt;P&gt;I found a post talking about saving the param as a cookie in my website code then pass it to ._hsq and if the variable matches a field on the contact proprety it should update it automatically, but it didn't.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 12:13:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Collecting-Session-URL/m-p/1145971#M42968</guid>
      <dc:creator>omaklad</dc:creator>
      <dc:date>2025-05-08T12:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting Session URL</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Collecting-Session-URL/m-p/1146159#M42976</link>
      <description>&lt;P&gt;Hey, &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/939702"&gt;@omaklad&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; welcome to our community. Thanks for your post. I think our community members need additional information before they can help. Can you share:&lt;/P&gt;
&lt;UL&gt;
 &lt;LI&gt;the post you are referring to&lt;/LI&gt;
 &lt;LI&gt;code example(s) of how you implemented this on your end&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Thank you! — Jaycee&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 17:53:54 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Collecting-Session-URL/m-p/1146159#M42976</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2025-05-08T17:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Collecting Session URL</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Collecting-Session-URL/m-p/1146181#M42977</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't find the exact post, but I basically&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put this code in my browser:&lt;BR /&gt;first to create the cookie:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;script&amp;gt;
  function getCookie(name) {
    var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
    return match ? decodeURIComponent(match[2]) : null;
  }

  var aid = getCookie('aid');

  if (aid &amp;amp;&amp;amp; window._hsq) {
    console.log('%c[HubSpot AID] Success:', 'color: green; font-weight: bold;', 'Found aid =', aid, '| Sending to HubSpot via _hsq');
    window._hsq.push(['identify', {
      aid: aid
    }]);
  } else if (!aid) {
    console.warn('%c[HubSpot AID] Warning:', 'color: orange; font-weight: bold;', 'No aid value found in cookie.');
  } else if (!window._hsq) {
    console.error('%c[HubSpot AID] Error:', 'color: red; font-weight: bold;', 'HubSpot tracking object (_hsq) not found.');
  }
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then to get the cookie and send it to hsq:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;script&amp;gt;
  function getCookie(name) {
    var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
    return match ? decodeURIComponent(match[2]) : null;
  }

  var aid = getCookie('aid');
  var maxAttempts = 10;
  var attempts = 0;

  var interval = setInterval(function () {
    if (typeof window._hsq !== 'undefined') {
      if (aid) {
        console.log('%c[HubSpot AID] Success:', 'color: green; font-weight: bold;', 'Found aid =', aid, '| Sending to HubSpot via _hsq');
        window._hsq.push(['identify', { aid: aid }]);
      } else {
        console.warn('%c[HubSpot AID] Warning:', 'color: orange; font-weight: bold;', 'No aid value found in cookie.');
      }
      clearInterval(interval);
    } else {
      attempts++;
      if (attempts &amp;gt;= maxAttempts) {
        console.error('%c[HubSpot AID] Error:', 'color: red; font-weight: bold;', 'HubSpot tracking object (_hsq) not found after 10 attempts.');
        clearInterval(interval);
      }
    }
  }, 500); // Check every 500ms
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;And assumed once the contact is created hubspot will be able to link that aid value to the customer contact field i created thats called aid too.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 18:34:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Collecting-Session-URL/m-p/1146181#M42977</guid>
      <dc:creator>omaklad</dc:creator>
      <dc:date>2025-05-08T18:34:51Z</dc:date>
    </item>
  </channel>
</rss>

