# Problem with chat (Hubspot conversations)

**URL:** <https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [April 22, 2020, 8:37pm UTC](https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300 "2020-04-22T20:37:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![evitoria](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evitoria/32/89259_2.png) [@evitoria](https://community.hubspot.com/u/evitoria)\
**Post date:** [April 22, 2020, 8:37pm UTC](https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300/1 "2020-04-22T20:37:39Z")

</div>

We have a chat using Hubspot, we already configured one chat as a sandbox for testing, we used the file [https://js.hs-scripts.com/FileIDSandbox.js](https://js.hs-scripts.com/FileIDSandbox.js) to do that. We have another file, that is supposed to be for production, that is [https://js.hs-scripts.com/FileIDProd.js](https://js.hs-scripts.com/FileIDProd.js). In my code, if I use FileIDSandbox, it works fine, but if I change to FileIDProd, it doesnt work.

When I try to invoke the following code using the FileIDProd:

```auto
window.HubSpotConversations.widget.open();

```

I got an undefined error, meaning that window doesnt have an object called HubSpotConversations.

I suspect that we need to have a redirected domain to make FileIDProd work, but I want to double check with Hubspot team. Also, if any other configuration is required, please let me know.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [April 23, 2020, 4:48am UTC](https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300/2 "2020-04-23T04:48:22Z")

</div>

Hey @evitoria,

Just to clarify, how are you configuring the the file to point to [https://js.hs-scripts.com/FileIDSandbox.js](https://js.hs-scripts.com/FileIDSandbox.js)? Typically, the [hs-scripts embed code](https://knowledge.hubspot.com/reports/what-is-the-hs-scripts-embed-code-loading-on-my-website) is identified by the portal ID i.e. \*[https://js.hs-scripts.com/portalID.js](https://js.hs-scripts.com/portalID.js) \*as such I’m curious how your team modified the link to point to the sanbox and prod.

---

<div class="post-metadata">

**Author:** ![evitoria](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evitoria/32/89259_2.png) [@evitoria](https://community.hubspot.com/u/evitoria)\
**Post date:** [April 23, 2020, 1:00pm UTC](https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300/3 "2020-04-23T13:00:05Z")

</div>

Hi @WendyGoh

At code level I invoke the file like this:

```auto
<script type="text/javascript" id="hs-script-loader" async defer src="https://js.hs-scripts.com/FileIDSandbox.js"></script>

```

Here FileIDSandbox is the number of our portal in Sandbox. We have another file for production, so if I change FileIDSandbox for the file of our production portal, it doesn’t work. Checking the configuration on Hubspot for the Sandbox portal, there is a section for Domains and URLs, which have the sandbox redirected to the [FileIDSandbox.hs-sites.com](http://FileIDSandbox.hs-sites.com):

 ![img1.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/8/8eae11757e6a413906151e86deca31e9c21405aa.png)

We don’t have that in our production portal, so I think that is is what we are missing, but I want to confirm this with Hubspot.

So in synthesis, what we need to configure on the Hubspot production portal to make the chat work?

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [April 24, 2020, 2:59am UTC](https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300/4 "2020-04-24T02:59:23Z")

</div>

Hey @evitoria,

I do not believe that you would need to set up the domain and URLs in order to use the chatflow via [Conversations API](https://developers.hubspot.com/docs/methods/conversations_api/hubspot-conversations-javascript-api).

In this case, could you check if your team has the [tracking code](https://knowledge.hubspot.com/articles/kcs_article/reports/install-the-hubspot-tracking-code) installed on the production page?

---

<div class="post-metadata">

**Author:** ![evitoria](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evitoria/32/89259_2.png) [@evitoria](https://community.hubspot.com/u/evitoria)\
**Post date:** [April 24, 2020, 2:58pm UTC](https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300/5 "2020-04-24T14:58:39Z")

</div>

Hi @WendyGoh ,

I followed the instructions on the link that you provided, everything seems to be configured correctly. Below are my findings:

- On the Network tab of the developer tools, the scripts are getting loaded correctly:

 ![instructions1.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/c/bc6c75deb1f359f0e0ce16a92063244ad4cc0adc.png)

- In the Hubspot account I checked the tracking code, there is no typo on our code:

 ![instructions2.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/f/dfdf8868ff35e4bdcc2ba95ae446b278dc685322.png)

- I checked the Advanced Tracking tab, and it seem that we have the tracking code ID set correctly:

 ![instructions3.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/f/8f53934b1525a5565216983e1eca4c851fec61a2.png)

But still, it doesn’t work. There is something else that we might verify?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [April 27, 2020, 5:07am UTC](https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300/6 "2020-04-27T05:07:17Z")

</div>

Hey @evitoria,

Could you share with me the following so that I can further troubleshoot this:

1. The page that you’d like the chat widget to appear (the production page).

2. The portal ID where you grab the production tracking code.

If it’s more comfortable for you, you can share these information via DM with me.

---

<div class="post-metadata">

**Author:** ![evitoria](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evitoria/32/89259_2.png) [@evitoria](https://community.hubspot.com/u/evitoria)\
**Post date:** [April 27, 2020, 2:23pm UTC](https://community.hubspot.com/t/problem-with-chat-hubspot-conversations/20300/7 "2020-04-27T14:23:46Z")

</div>

Hi @WendyGoh ,

A coworker finally found the option that make this work.

It is on the conversations menu, on the top panel:

 ![option_that_work.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/d/9dc78cbafe2f5a952a62c0d2db2b1df13b3bdd87.png)

After setting this to the correct domain it worked.

Thanks for your assitance.
