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 to do that. We have another file, that is supposed to be for production, that is 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:
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.
Hey @evitoria,
Just to clarify, how are you configuring the the file to point to https://js.hs-scripts.com/FileIDSandbox.js? Typically, the hs-scripts embed code is identified by the portal ID i.e. *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.
Hi @WendyGoh
At code level I invoke the file like this:
<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:
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?
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.
In this case, could you check if your team has the tracking code installed on the production page?
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:
- In the Hubspot account I checked the tracking code, there is no typo on our code:
- I checked the Advanced Tracking tab, and it seem that we have the tracking code ID set correctly:
But still, it doesn’t work. There is something else that we might verify?
Thanks for your help.
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.
Hi @WendyGoh ,
A coworker finally found the option that make this work.
It is on the conversations menu, on the top panel:
After setting this to the correct domain it worked.
Thanks for your assitance.