<?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 Use hutk to identify visitor in tracking code in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/721250#M31544</link>
    <description>&lt;P&gt;I am trying to implement a solution where I have an embedded app in an iframe.&amp;nbsp; I want to track using the tracking code.&amp;nbsp; However, since rules are strict iframes cannot access the cookies stored by hubspot in the parent site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am passing __hstc __hssc and __hsfp through url params into the iframe, but I need to somehow use the identify function to link a contact to this session info.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 23:23:36 GMT</pubDate>
    <dc:creator>AWilliamson29</dc:creator>
    <dc:date>2022-11-21T23:23:36Z</dc:date>
    <item>
      <title>Use hutk to identify visitor in tracking code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/721250#M31544</link>
      <description>&lt;P&gt;I am trying to implement a solution where I have an embedded app in an iframe.&amp;nbsp; I want to track using the tracking code.&amp;nbsp; However, since rules are strict iframes cannot access the cookies stored by hubspot in the parent site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am passing __hstc __hssc and __hsfp through url params into the iframe, but I need to somehow use the identify function to link a contact to this session info.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 23:23:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/721250#M31544</guid>
      <dc:creator>AWilliamson29</dc:creator>
      <dc:date>2022-11-21T23:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Use hutk to identify visitor in tracking code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/721721#M31554</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/480549"&gt;@AWilliamson29&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for reaching out. Let's see if we can get the converstaion going — hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/257487"&gt;@LMeert&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/101257"&gt;@assi&lt;/a&gt;&amp;nbsp;do you have any experience with the type of project&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/480549"&gt;@AWilliamson29&lt;/a&gt;&amp;nbsp;is describing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you! — Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 17:45:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/721721#M31554</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2022-11-22T17:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Use hutk to identify visitor in tracking code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/721795#M31558</link>
      <description>&lt;DIV class=""&gt;This might fill in some of the gaps.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;We have a use case where we are embedding our app inside our client’s website.&amp;nbsp; They want so integrate their tracking code with the embedded iframe and gate it with a hubspot form.&amp;nbsp; Iframe security doesn’t allow the iframe to access the cookies from the parent site so form submissions were showing up without a cookie and page views were coming through as anonymous. I passed through the cross domain tracking params from the parent site to the iframe and submitted the form with the parent hutk attached.&lt;/DIV&gt;&lt;PRE&gt; // parent site embed code for the iframe
&amp;lt;script&amp;gt;
  var _hsq = window._hsq = window._hsq || [];
  var crossDomainTrackingParams = "";
  _hsq.push(['addIdentityListener', function(hstc, hssc, hsfp) {
    crossDomainTrackingParams = '?__hstc=' + hstc + '&amp;amp;__hssc=' + hssc + '&amp;amp;__hsfp=' + hsfp;
    var link = "&lt;A class="" href="https://hypothetical-demo-link.dev/" target="_blank" rel="noopener noreferrer"&gt;https://hypothetical-link.dev/&lt;/A&gt;" + crossDomainTrackingParams;
    console.log(link);
    document.getElementById("my-iframe").src=encodeURI(link);
  }]);
&amp;lt;/script&amp;gt;
  
// Form creation code within the iframe (parsed out the hutk on the backend and passed it to the template)
hbspt.forms.create({
  portalId: "{{hubspot_portal_id}}",
  formId: "{{hubspot_form_id}}",
  target: "#form_{{hubspot_form_id}}",
  hutk: "{{hutk}}",
  onFormSubmitted: function($form, ctx) {
    const button = document.getElementById("submitButton");
    button.click();
    return false;
  }
});&lt;/PRE&gt;&lt;DIV class=""&gt;This was able to link the form submission with the parent page view via passing through the hutk.&amp;nbsp; However I am trying to leverage the hutk to identify the page view event with something like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;_hsq.push(["identify", {hutk: hutk}])&amp;nbsp; but i’m noticing that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;vi&amp;nbsp; param is not changing in the network call, nor is the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;i:hutk=&amp;lt;hutk-id&amp;gt;&amp;nbsp; tying the page views to the contact generated by the form.Is there something I can use to tie the session data to the contact via the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;"identify"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hutk&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or otherwise?&lt;/DIV&gt;</description>
      <pubDate>Tue, 22 Nov 2022 19:53:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/721795#M31558</guid>
      <dc:creator>AWilliamson29</dc:creator>
      <dc:date>2022-11-22T19:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Use hutk to identify visitor in tracking code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/723756#M31619</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;I'm still stuck on this.&amp;nbsp; Let me know if there's anybody who can unblock this effort.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 18:07:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/723756#M31619</guid>
      <dc:creator>AWilliamson29</dc:creator>
      <dc:date>2022-11-28T18:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Use hutk to identify visitor in tracking code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/781740#M33792</link>
      <description>&lt;P&gt;Just an idea to try, postMessage from the parent to iframe ?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 00:46:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/781740#M33792</guid>
      <dc:creator>kevinfilteau</dc:creator>
      <dc:date>2023-04-14T00:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Use hutk to identify visitor in tracking code</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/781741#M33793</link>
      <description>&lt;P&gt;Or add params to iframe url ?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 00:47:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Use-hutk-to-identify-visitor-in-tracking-code/m-p/781741#M33793</guid>
      <dc:creator>kevinfilteau</dc:creator>
      <dc:date>2023-04-14T00:47:26Z</dc:date>
    </item>
  </channel>
</rss>

