APIs & Integrations

Helly_Panchal
Member

Stop hubspot from automatically adding js-hs scripts to head section of my website

Hi,

We use hubspot for various domains. We require the live-chat/messages functionality on one of our domains. However, on that domain we want to disable the collected forms functionality.

We were able to achieve this by modifying the js-hs script and adding it in footer. But after a few days, we noticed that the js-hs script it re-added in head section of our site.

How do we stop that script from getting added? Is it something automatic or some hubspot settings have changed?

5 Replies 5
cbarley
HubSpot Alumni
HubSpot Alumni

Stop hubspot from automatically adding js-hs scripts to head section of my website

Hi @Helly_Panchal, there weren't any updates on the HubSpot end. That said, comparing your sites code with my own site, I'm able to see that mine does have the same Collected Forms script loaded in when I toggle this setting: https://app.hubspot.com/settings/3430672/marketing/form/non-hubspot

Since you have the HubSpot script loader in the header of your page (http://prntscr.com/m2l6b4), HubSpot will automatically load any scripts that you opt to use (Collected forms, messages, etc.). There unfortunately isn't a way to prevent this

0 Upvotes
Helly_Panchal
Member

Stop hubspot from automatically adding js-hs scripts to head section of my website

Hi @Connor_Barley, actually I am trying to achieve it by manually just adding the messaging part and excluding the collected forms script code in the footer of my website. This was working fine for a couple of days. The form data was not collected and even the chat bot was working all fine.

However since a week's time, we see that hubspot is automatically adding a lot of scripts in head section of that site. Just wanted to know if this is part of any new updates in hubspot recently.

This is the site: http://book-setup.smartagents.com

You can inspect the head section and footer through developer tools and see what I am talking about.

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Stop hubspot from automatically adding js-hs scripts to head section of my website

Hey @Helly_Panchal, there's not currently a way to disable Collected Forms on a per-domain basis while still using the tracking code for other purposes. It seems like a good feature though, so I'd recommend posting it in the Ideas forum for tracking purposes, while I reach out internally.

0 Upvotes
cbarley
HubSpot Alumni
HubSpot Alumni

Stop hubspot from automatically adding js-hs scripts to head section of my website

Hi @Helly_Panchal, so that we're on the same page (pun intended), I'd love to take a look at a page where the js-script is being added. I do believe this is intentional in order for live chat to work (you should be able to disable collected forms in app: https://knowledge.hubspot.com/articles/kcs_article/non-hubspot-forms/use-non-hubspot-forms), but want to see exactly what's going on

0 Upvotes
Helly_Panchal
Member

Stop hubspot from automatically adding js-hs scripts to head section of my website

We can not disable the collected forms as we require it on other domains.

We just want to disable it on a single domain. Is that possible?

0 Upvotes