HubSpotConversations undefined

Hi all,

I targeted a html page with a chat. The chat works, but I am unable to reference the HubSpotConversations object. It is undefined. This is the line.

The trackiwindow.HubSpotConversations.clear();

The tracking script is there.

I read something about adding the subdomain to domains. I can’t add the CNAME of the subdomain because I need that subdomain pointed to another server.

Is there a way to get HubSpotConversations to load?

Thanks,

Chris

Hey, @modemodom :waving_hand: Thanks for your question! Without a link, it’s challenging for the community to be able to troubleshoot the issue alongside you.

Some general thoughts based on what I’ve seen here in the community:

  • Are you calling window.HubSpotConversations.clear(); inside a $(document).ready() or a window.onload event?
  • Are you trying to use the window.HubSpotConversations.clear(); in a certain script that runs before the HubSpot tracking code?
  • Is there a console error?

Thank you for the additional information! — Jaycee

Hi Jaycee,

The file is https://support.boxlight.com/panel-chat.html.

The script is before the end body tag.

I didn’t have it inside either one. It failed with the error “Cannot read properties of undefined (reading ‘clear’)”.

I currently have it inside document.onreadystatechange = function () { }.

It fails with the same error.

Any thoughts?

Thanks,

Chris

Hi Jaycee,

I got past the error with window.addEventListener(‘load’, function () { }.

I was hoping the chat would start over with a browser refresh, but neither of these lines work.

window.HubSpotConversations.clear();
window.HubSpotConversations.clear({resetWidget:true});

Any thoughts?

Thanks,

Chris