diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 69bbabd26d13..c4acdfa829e3 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -229,7 +229,15 @@ const config = { ], ], - scripts: ['/js/crisp-chat.js'], + scripts: [ + '/js/crisp-chat.js', + { + src: '//js-eu1.hs-scripts.com/143451822.js', + async: true, + defer: true, + id: 'hs-script-loader', + }, + ], clientModules: [require.resolve('./plugins/crisp-chat-links.js')], }; diff --git a/frontend/env/project_prod.js b/frontend/env/project_prod.js index 24d0d388e496..752cba97fa40 100644 --- a/frontend/env/project_prod.js +++ b/frontend/env/project_prod.js @@ -20,6 +20,8 @@ module.exports = global.Project = { flagsmithClientAPI: 'https://api.flagsmith.com/api/v1/', flagsmithClientEdgeAPI: 'https://edge.api.flagsmith.com/api/v1/', + + hubspot: '//js-eu1.hs-scripts.com/143451822.js', // This is used for Sentry tracking maintenance: false, plans: { diff --git a/frontend/web/project/libs.js b/frontend/web/project/libs.js index e4de669b1f5c..484f42f530ed 100644 --- a/frontend/web/project/libs.js +++ b/frontend/web/project/libs.js @@ -123,3 +123,14 @@ if(Project.linkedinPartnerTracking) { img.setAttribute("src", "https://px.ads.linkedin.com/collect/?pid=5747572&fmt=gif"); document.body.appendChild(img); } + +if(Project.hubspot) { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.id = "hs-script-loader"; + script.async = true; + script.defer = true; + script.src = Project.hubspot; + + document.head.appendChild(script); +}