APIs & Integrations

prafulmemane
Mitglied

Control the scripts injected in the website

Hi team,

We believe this script in the footer, intended to allow for Hubspot analytics, is the entry.

image-2019-11-21-15-44-34-803[1].png

Which in turns calls theimage-2019-11-21-15-44-04-442[2].png

 

The earlier embed article mentions how HubSpot can inject messages or pop-up forms on our site by piggy-backing on this above JS files.

 

Is it technically possible to block certain scripts from hitting the www site and limiting to the sub-domain? Or allowing analytics script injections but blocking others?

 

Knowledge base links:

Script on our site: https://knowledge.hubspot.com/reports/what-is-the-hs-scripts-embed-code-loading-on-my-website

More general knowledge: https://knowledge.hubspot.com/cos-general/how-can-i-add-code-snippets-to-the-head-and-footer-html-of...

https://knowledge.hubspot.com/reports/what-is-the-hs-scripts-embed-code-loading-on-my-website

 

0 Upvotes
3 Antworten
Willson
HubSpot Employee
HubSpot Employee

Control the scripts injected in the website

Hi @prafulmemane 

 

It is currently not possible to restrict certain scripts that are injected as part of our Tracking Code on sub-domains.

 

When the Tracking Code fires, this works as a script-loader for any subsequent scripts that are required to run certain HubSpot features on your pages where the Tracking Code is added. As this works as the initial script-loader, we cannot remove this without removing all HubSpot functionality. 

 

With relation to the per sub-domain aspect, it seems like a good feature though, so I'd recommend posting it in the Ideas forum which can be found here: https://community.hubspot.com/t5/HubSpot-Ideas/idb-p/HubSpot_Ideas

 

I hope this helps!

Product Manager @ HubSpot
prafulmemane
Mitglied

Control the scripts injected in the website

Hi @Willson , Thank you for the response. Is it possible to control the script to be only loaded on a specific culture website. We use Sitecore CMS, GTM to drop our scripts in pages so the appropriate call to hubspot is made for collecting analytics information and other function used by the regional markets ?

Thanks!

0 Upvotes
Willson
HubSpot Employee
HubSpot Employee

Control the scripts injected in the website

Hi @prafulmemane 


This would depend on the extent of HubSpot features which are tied to the Tracking Code that you're looking to use. 

 

If you are only wanting it for the specific injection of scripts and are not worried about Analyitcal aspects such as website analytics, then in theory, applying the Tracking Code via GTM would allow you to control which sites the code was deployed on. 

 

However, if you're wanting to use the Analytical aspect of the Tracking Code across your sites, we would not have a method of limiting this functionality currently. 

 

I hope this helps!

Product Manager @ HubSpot
0 Upvotes