Skip to content

Commit

Permalink
feat: Add hubspot (#4698)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
kyle-ssg and pre-commit-ci[bot] authored Oct 7, 2024
1 parent 3988213 commit c4faf69
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')],
};
Expand Down
2 changes: 2 additions & 0 deletions frontend/env/project_prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
11 changes: 11 additions & 0 deletions frontend/web/project/libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit c4faf69

Please sign in to comment.