Skip to content

Commit c3882b0

Browse files
Update loading of script
1 parent ebb045d commit c3882b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

integrations/hubspot/src/script.raw.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function (h, u, b, s, p, o, t) {
1+
function loadScScript() {
22
if (!u.getElementById(b)) {
33
const trackingID = '<TO_REPLACE_SCRIPT_LOADER_ID>';
44

@@ -14,4 +14,12 @@
1414
o = h._hsp = h._hsp || [];
1515
o.push(['setContentType', 'knowledge-article']);
1616
}
17+
}
18+
19+
(function (h, u, b, s, p, o, t) {
20+
if (document.readyState === 'loading') {
21+
document.addEventListener('DOMContentLoaded', loadScScript);
22+
} else {
23+
loadScScript();
24+
}
1725
})(window, document, 'hs-script-loader');

0 commit comments

Comments
 (0)