<?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: Using HS tracking script with Conversation API in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Using-HS-tracking-script-with-Conversation-API/m-p/874678#M68804</link>
    <description>&lt;P&gt;Thanks for the reply,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;, one more followup question:&lt;BR /&gt;Does the '&lt;STRONG&gt;&lt;EM&gt;HubSpot All-In-One Marketing - Forms, Popups, Live Chat&lt;/EM&gt;&lt;/STRONG&gt;' Wordpress plugin perform the same functions as both of those other scripts?&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2023 21:57:52 GMT</pubDate>
    <dc:creator>STapp</dc:creator>
    <dc:date>2023-11-03T21:57:52Z</dc:date>
    <item>
      <title>Using HS tracking script with Conversation API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-HS-tracking-script-with-Conversation-API/m-p/873549#M68715</link>
      <description>&lt;P data-unlink="true"&gt;Question: Does the HS tracking code script (&lt;SPAN&gt;&amp;lt;script type="text/javascript" id="hs-script-loader" async defer src="&lt;/SPAN&gt;&lt;STRONG&gt;js.hs-scripts.com/XXXXXXX.js&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;) provides the same functions as the HS Conversation API scripts seend below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;script type="text/javascript"&amp;gt;
  function onConversationsAPIReady() {
    //console.log(`HubSpot Conversations API: ${window.HubSpotConversations}`);
    window.HubSpotConversations.on( 'conversationStarted', function(payload) {
    //console.log("HubSpot Conversation Started");
      window.dataLayer.push({
        'event': 'HubSpot',
        'hs-action': 'conversation-started',
        'hs-conversation-id': payload.conversation.conversationId
      })
    });
    //Listens for the conversation window to be closed
    window.HubSpotConversations.on( 'conversationClosed', function(payload) {
    //console.log("HubSpot Conversation Closed");
    //This means the conversation is fully closed. Minimizing doesn't count.
      window.dataLayer.push({
        'event': 'HubSpot',
        'hs-action': 'conversation-closed',
        'hs-conversation-id': payload.conversation.conversationId
      })
    });
    
    //Listens for a change in the number of unread messages
    window.HubSpotConversations.on( 'unreadConversationCountChanged', function(payload) {
    //console.log("HubSpot Unread Messages Count Change");
      window.dataLayer.push({
        'event': 'HubSpot',
        'hs-action': 'unread-message-count-change',
        'hs-conversation-id': payload.unreadCount
      })
    });
  }
  /*
   If external API methods are already available, use them.
  */
  if (window.HubSpotConversations) {
    //console.log('The api is ready already');
    onConversationsAPIReady();
  } else {
    /*
      Otherwise, callbacks can be added to the hsConversationsOnReady on the window object.
      These callbacks will be called once the external API has been initialized.
    */
    window.hsConversationsOnReady = [onConversationsAPIReady];
  }
 &amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 23:39:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-HS-tracking-script-with-Conversation-API/m-p/873549#M68715</guid>
      <dc:creator>STapp</dc:creator>
      <dc:date>2023-11-01T23:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using HS tracking script with Conversation API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-HS-tracking-script-with-Conversation-API/m-p/874100#M68754</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/657295"&gt;@STapp&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for the great question. It's definitely worth calling out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To directly answer your question:&lt;/P&gt;
&lt;P&gt;No, the HS tracking code script does not provide the same functionalities as the HS Conversation API script.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The HS tracking code script is more general and focuses on broader website analytics and behaviors&lt;/LI&gt;
&lt;LI&gt;The HS Conversation API script is specific to chat and conversation events&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you are planning to utilize both tracking functionalities and conversation events, you'll likely want to include both scripts on your website.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Jaycee&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 21:31:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-HS-tracking-script-with-Conversation-API/m-p/874100#M68754</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-11-02T21:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using HS tracking script with Conversation API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-HS-tracking-script-with-Conversation-API/m-p/874678#M68804</link>
      <description>&lt;P&gt;Thanks for the reply,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;, one more followup question:&lt;BR /&gt;Does the '&lt;STRONG&gt;&lt;EM&gt;HubSpot All-In-One Marketing - Forms, Popups, Live Chat&lt;/EM&gt;&lt;/STRONG&gt;' Wordpress plugin perform the same functions as both of those other scripts?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 21:57:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-HS-tracking-script-with-Conversation-API/m-p/874678#M68804</guid>
      <dc:creator>STapp</dc:creator>
      <dc:date>2023-11-03T21:57:52Z</dc:date>
    </item>
  </channel>
</rss>

